### Question:
TemplateRegistry { public synchronized Template lookup(Type targetType) { Template tmpl; if (targetType instanceof ParameterizedType) { ParameterizedType paramedType = (ParameterizedType) targetType; tmpl = lookupGenericType(paramedType); if (tmpl != null) { return tmpl; } targetType = paramedType.getRawType(); } tmpl = lookupGenericArrayType(targetType); if (tmpl != null) { return tmpl; } tmpl = lookupCache(targetType); if (tmpl != null) { return tmpl; } if (targetType instanceof WildcardType || targetType instanceof TypeVariable) { tmpl = new AnyTemplate<Object>(this); register(targetType, tmpl); return tmpl; } Class<?> targetClass = (Class<?>) targetType; if (MessagePackable.class.isAssignableFrom(targetClass)) { tmpl = new MessagePackableTemplate(targetClass); register(targetClass, tmpl); return tmpl; } if (targetClass.isInterface()) { tmpl = new AnyTemplate<Object>(this); register(targetType, tmpl); return tmpl; } tmpl = lookupAfterBuilding(targetClass); if (tmpl != null) { return tmpl; } tmpl = lookupInterfaceTypes(targetClass); if (tmpl != null) { return tmpl; } tmpl = lookupSuperclasses(targetClass); if (tmpl != null) { return tmpl; } tmpl = lookupSuperclassInterfaceTypes(targetClass); if (tmpl != null) { return tmpl; } throw new MessageTypeException( "Cannot find template for " + targetClass + " class. " + "Try to add @Message annotation to the class or call MessagePack.register(Type)."); } private  TemplateRegistry();  TemplateRegistry(TemplateRegistry registry); void setClassLoader(final ClassLoader cl); void register(final Class<?> targetClass); void register(final Class<?> targetClass, final FieldList flist); synchronized void register(final Type targetType, final Template tmpl); synchronized void registerGeneric(final Type targetType, final GenericTemplate tmpl); synchronized boolean unregister(final Type targetType); synchronized void unregister(); synchronized Template lookup(Type targetType);  }### Answer:
@Test public void testArraysAsListIsPackable() throws Exception { Template<?> template = root.lookup(Arrays.asList().getClass()); assertThat(template, is(instanceOf(ListTemplate.class))); }
@Test public void testTraverseInterface() throws Exception { Template<?> template = root.lookup(List.class); assertThat(template, is(instanceOf(ListTemplate.class))); }
@Test public void testTraverseDescentInterface() throws Exception { Template<?> template = root.lookup(MyArrayList.class); assertThat(template, is(instanceOf(ListTemplate.class))); }