AvroSerialiser implements ToBytesSerialiser<Object> { @Override public boolean canHandle(final Class clazz) { if ("java.lang.Class".equals(clazz.getName())) { return false; } try { ReflectData.get().getSchema(clazz); } catch (final RuntimeException e) { return false; } return true; }  @Override byte[] serialise(final Object object); @Override Object deserialise(final byte[] allBytes, final int offset, final int length); @Override Object deserialise(final byte[] bytes); @Override Object deserialiseEmpty(); @Override boolean preservesObjectOrdering(); @Override boolean canHandle(final Class clazz); @Override boolean isConsistent(); @Override boolean equals(final Object obj); @Override int hashCode();  }
@Test public void testCanHandleObjectClass() { assertTrue(serialiser.canHandle(Object.class)); }