### Question:
JSONService { public <T> Set<String> serializeSet(Set<T> objects) { return FluentIterable.from(objects) .transform(new Function<T, String>() { @Override public String apply(T input) { return serialize(input); } }) .toSet(); } @Inject protected  JSONService(); T deserialize(Class<T> t, String json); Set<T> deserializeSet(final Class<T> t, Set<String> jsons); String serialize(Object object); Set<String> serializeSet(Set<T> objects);  }### Answer:
@Test public void testSerializeSetSingleValue() { ImmutableSet<MSEventUid> msEventUids = ImmutableSet.<MSEventUid> of(new MSEventUid("uid")); Set<String> serialized = new JSONService().serializeSet(msEventUids); assertThat(serialized).containsOnly("{\"uid\":\"uid\"}"); }
@Test public void testSerializeSet() { ImmutableSet<MSEventUid> msEventUids = ImmutableSet.<MSEventUid> of(new MSEventUid("uid1"), new MSEventUid("uid2")); Set<String> serialized = new JSONService().serializeSet(msEventUids); assertThat(serialized).containsOnly("{\"uid\":\"uid1\"}", "{\"uid\":\"uid2\"}"); }
@Test public void testSerializeEmptySet() { ImmutableSet<MSEventUid> msEventUids = ImmutableSet.<MSEventUid> of(); Set<String> serialized = new JSONService().serializeSet(msEventUids); assertThat(serialized).isEmpty(); }