TreeSetStringSerialiser extends ToBytesViaStringDeserialiser<TreeSet<String>> { @Override public boolean canHandle(final Class clazz) { return TreeSet.class.isAssignableFrom(clazz); } TreeSetStringSerialiser(); @Override boolean canHandle(final Class clazz); @Override TreeSet<String> deserialiseString(final String value); @Override TreeSet<String> deserialiseEmpty(); @Override boolean preservesObjectOrdering(); @Override boolean isConsistent(); @Override boolean equals(final Object obj); @Override int hashCode();  }
@Test public void shouldBeAbleToHandleATreeSet() { final Class testClass = TreeSet.class; final boolean canHandle = serialiser.canHandle(testClass); assertTrue(canHandle); }
@Test public void shouldNotBeAbleToHandleAHashSet() { final Class testClass = HashSet.class; final boolean canHandle = serialiser.canHandle(testClass); assertFalse(canHandle); }