Hazelcast: How to use a List as key in hazelcast
<p>When my java service starts, I am fetching a list of String from the database and hence would cache them in hazelcast, key being the list of String and the value (say) 100. There could be multiple lists with different values. The idea is that the next time when my method receives the String as an argument, I should be able to look it up in the hazelcast and return the value.</p>

<p>For example:</p>

<pre><code>// These lists are populated from database
List&lt;String&gt; list_1 = new ArrayList&lt;&gt;();
list_1.add("A");
list_1.add("B");

List&lt;String&gt; list_2 = new ArrayList&lt;&gt;();
list_2.add("C");
list_2.add("D");

hazelcast.put("CACHE_KEY_1", list_1, 111);
hazelcast.put("CACHE_KEY_2", list_2, 222);
</code></pre>

<p>So when my method receives "C" as an argument, the hazelcast should be able to retrieve the value i.e.</p>

<pre><code>int value = hazelcast.get("CACHE_KEY_2", "C"); // should return 222
</code></pre>

<p>I tried looking up this functionality in the documentation but couldn't get any idea about implementing this.</p>

<p>Any pointers would be really helpful.</p>

<p>Thanks,
Rahul</p>