File tree Expand file tree Collapse file tree 2 files changed +32
-1
lines changed
src/nl/melp/redis/collections
test/nl/melp/redis/collections Expand file tree Collapse file tree 2 files changed +32
-1
lines changed Original file line number Diff line number Diff line change @@ -130,6 +130,25 @@ public Collection<Set<V>> values() {
130130
131131 @ Override
132132 public Set <Entry <K , Set <V >>> entrySet () {
133- throw new UnsupportedOperationException ();
133+ Set <Entry <K , Set <V >>> set = new HashSet <>();
134+ for (K k : keySet ()) {
135+ set .add (new Entry <>() {
136+ @ Override
137+ public K getKey () {
138+ return k ;
139+ }
140+
141+ @ Override
142+ public Set <V > getValue () {
143+ return get (k );
144+ }
145+
146+ @ Override
147+ public Set <V > setValue (Set <V > o ) {
148+ throw new UnsupportedOperationException ("Not implemented" );
149+ }
150+ });
151+ }
152+ return set ;
134153 }
135154}
Original file line number Diff line number Diff line change @@ -243,6 +243,18 @@ public void testSerializedMappedSet() throws IOException {
243243 assertEquals (0 , secondary .size ());
244244 assertFalse (values .get ("foo" ).contains ("bar" ));
245245 assertFalse (secondary .get ("foo" ).contains ("bar" ));
246+
247+ values .get ("A" ).add ("1" );
248+ values .get ("A" ).add ("2" );
249+ values .get ("A" ).add ("3" );
250+ values .get ("B" ).add ("1" );
251+ values .get ("B" ).add ("2" );
252+ values .get ("B" ).add ("3" );
253+
254+ var l = new ArrayList <String >();
255+ for (var e : values .entrySet ()) {
256+ l .add (e .getKey () + "." + e .getValue ());
257+ }
246258 }
247259
248260 clear ();
You can’t perform that action at this time.
0 commit comments