### Question:
TypeHandlerRegistry { public <T> TypeHandler<T> getTypeHandler(Class<T> type) { return getTypeHandler((Type) type, null); } TypeHandlerRegistry();  TypeHandlerRegistry(Configuration configuration); void setDefaultEnumTypeHandler(Class<? extends TypeHandler> typeHandler); boolean hasTypeHandler(Class<?> javaType); boolean hasTypeHandler(TypeReference<?> javaTypeReference); boolean hasTypeHandler(Class<?> javaType, JdbcType jdbcType); boolean hasTypeHandler(TypeReference<?> javaTypeReference, JdbcType jdbcType); TypeHandler<?> getMappingTypeHandler(Class<? extends TypeHandler<?>> handlerType); TypeHandler<T> getTypeHandler(Class<T> type); TypeHandler<T> getTypeHandler(TypeReference<T> javaTypeReference); TypeHandler<?> getTypeHandler(JdbcType jdbcType); TypeHandler<T> getTypeHandler(Class<T> type, JdbcType jdbcType); TypeHandler<T> getTypeHandler(TypeReference<T> javaTypeReference, JdbcType jdbcType); TypeHandler<Object> getUnknownTypeHandler(); void register(JdbcType jdbcType, TypeHandler<?> handler); @SuppressWarnings("unchecked") void register(TypeHandler<T> typeHandler); void register(Class<T> javaType, TypeHandler<? extends T> typeHandler); void register(TypeReference<T> javaTypeReference, TypeHandler<? extends T> handler); void register(Class<T> type, JdbcType jdbcType, TypeHandler<? extends T> handler); void register(Class<?> typeHandlerClass); void register(String javaTypeClassName, String typeHandlerClassName); void register(Class<?> javaTypeClass, Class<?> typeHandlerClass); void register(Class<?> javaTypeClass, JdbcType jdbcType, Class<?> typeHandlerClass); @SuppressWarnings("unchecked") TypeHandler<T> getInstance(Class<?> javaTypeClass, Class<?> typeHandlerClass); void register(String packageName); Collection<TypeHandler<?>> getTypeHandlers();  }### Answer:
@Test void shouldReturnHandlerForSuperclassIfRegistered() { class MyDate extends Date { private static final long serialVersionUID = 1L; } assertEquals(DateTypeHandler.class, typeHandlerRegistry.getTypeHandler(MyDate.class).getClass()); }
@Test void shouldReturnHandlerForSuperSuperclassIfRegistered() { class MyDate1 extends Date { private static final long serialVersionUID = 1L; } class MyDate2 extends MyDate1 { private static final long serialVersionUID = 1L; } assertEquals(DateTypeHandler.class, typeHandlerRegistry.getTypeHandler(MyDate2.class).getClass()); }