Add Collections.emptySet()
Change-Id: I51e845ed69f688a859089a221643fd6d04ac7afa
Showing
2 changed files
with
6 additions
and
0 deletions
... | @@ -153,6 +153,7 @@ public final class KryoNamespaces { | ... | @@ -153,6 +153,7 @@ public final class KryoNamespaces { |
153 | .register(new ArraysAsListSerializer(), Arrays.asList().getClass()) | 153 | .register(new ArraysAsListSerializer(), Arrays.asList().getClass()) |
154 | .register(Collections.singletonList(1).getClass()) | 154 | .register(Collections.singletonList(1).getClass()) |
155 | .register(Duration.class) | 155 | .register(Duration.class) |
156 | + .register(Collections.emptySet().getClass()) | ||
156 | .build(); | 157 | .build(); |
157 | 158 | ||
158 | /** | 159 | /** | ... | ... |
... | @@ -72,6 +72,7 @@ import org.onlab.util.KryoNamespace; | ... | @@ -72,6 +72,7 @@ import org.onlab.util.KryoNamespace; |
72 | 72 | ||
73 | import java.nio.ByteBuffer; | 73 | import java.nio.ByteBuffer; |
74 | import java.util.Arrays; | 74 | import java.util.Arrays; |
75 | +import java.util.Collections; | ||
75 | import java.util.HashMap; | 76 | import java.util.HashMap; |
76 | import java.util.Map; | 77 | import java.util.Map; |
77 | import java.util.Set; | 78 | import java.util.Set; |
... | @@ -342,6 +343,10 @@ public class KryoSerializerTest { | ... | @@ -342,6 +343,10 @@ public class KryoSerializerTest { |
342 | testSerializedEquals(new DefaultGroupId(99)); | 343 | testSerializedEquals(new DefaultGroupId(99)); |
343 | } | 344 | } |
344 | 345 | ||
346 | + @Test | ||
347 | + public void testEmptySet() { | ||
348 | + testSerializedEquals(Collections.emptySet()); | ||
349 | + } | ||
345 | 350 | ||
346 | @Test | 351 | @Test |
347 | public void testAnnotations() { | 352 | public void testAnnotations() { | ... | ... |
-
Please register or login to post a comment