SetSerialiser implements ToBytesSerialiser<Set<? extends Object>> { @Override public Set<? extends Object> deserialiseEmpty() throws SerialisationException { Set set; if (null == getSetClass()) { set = new HashSet<>(); } else { try { set = getSetClass().newInstance(); } catch (final IllegalAccessException | IllegalArgumentException | SecurityException | InstantiationException e) { throw new SerialisationException("Failed to create map instance" + e.getMessage(), e); } } return set; } SetSerialiser();  SetSerialiser(final ToBytesSerialiser objectSerialiser); @Override boolean canHandle(final Class clazz); @Override byte[] serialise(final Set<? extends Object> object); @Override Set<? extends Object> deserialise(final byte[] bytes); @Override Set<? extends Object> deserialiseEmpty(); @Override boolean preservesObjectOrdering(); @Override boolean isConsistent(); @Override byte[] serialiseNull(); @JsonIgnore ToBytesSerialiser getObjectSerialiser(); @JsonIgnore void setObjectSerialiser(final ToBytesSerialiser objectSerialiser); @JsonGetter("objectSerialiser") String getObjectSerialiserClassString(); @JsonSetter("objectSerialiser") void setObjectSerialiserClassString(final String classType); @JsonGetter("setClass") String getSetClassString(); @JsonSetter("setClass") void setSetClassString(final String classType); @JsonIgnore Class<? extends Set> getSetClass(); @JsonIgnore void setSetClass(final Class<? extends Set> setClass); @Override boolean equals(final Object obj); @Override int hashCode();  }
@Test @Override public void shouldDeserialiseEmpty() throws SerialisationException { assertEquals(new HashSet(), serialiser.deserialiseEmpty()); }