private <T> Template<T> lookupGenericInterfaceTypes(ParameterizedType targetType) {
        Type rawType = targetType.getRawType();
        Template<T> tmpl = null;

        try {
            Class<?>[] infTypes = ((Class) rawType).getInterfaces();
            for (Class<?> infType : infTypes) {
                tmpl = lookupGenericTypeImpl0(targetType, infType);
                if (tmpl != null) {
                    return tmpl;
                }
            }
        } catch (ClassCastException e) { // ignore
        }

        return tmpl;
    }