@Test public void testForFunction_Serializable() { Navigator<Integer> navigator = SerializationUtils.serializedCopy( Navigators.forFunction(ImmutableSet.of(1, 2, 3), new MyFun())); assertEquals(ImmutableSet.of(1, 2, 3), ImmutableSet.copyOf(navigator.domain())); assertEquals(ImmutableSet.of(2, 2), ImmutableSet.copyOf(navigator.related(1))); assertEquals(ImmutableSet.of(4, 3), ImmutableSet.copyOf(navigator.related(2))); assertEquals(ImmutableSet.of(6, 4), ImmutableSet.copyOf(navigator.related(3))); }