In Java does a data type like this exist?
<p>I found this in redis and was trying to see if there was anything similar in Java.  Say I have the following data:</p>

<pre><code>3:1
3:2
3:3
4:1
</code></pre>

<p>As you can see non of the data points on their own are unique but the combination is unique.  There is a command in redis:</p>

<pre><code>sadd 3 1 2
sadd 3 3
sadd 4 1
</code></pre>

<p>That would give me a something like this:</p>

<pre><code>3 -&gt; 1, 2, 3
4 -&gt; 1
</code></pre>

<p>By doing something like <code>smembers 3</code>(this would return everything for 3) or <code>smembers 3 2</code>(this would return if the subvalue exists). </p>

<p>I'm wondering what the closest I can get to this functionality within Java? </p>
