private Template<Type> lookupGenericType(ParameterizedType paramedType) {
        Template<Type> tmpl = lookupGenericTypeImpl(paramedType);
        if (tmpl != null) {
            return tmpl;
        }

        try {
            tmpl = parent.lookupGenericTypeImpl(paramedType);
            if (tmpl != null) {
                return tmpl;
            }
        } catch (NullPointerException e) { // ignore
        }

        tmpl = lookupGenericInterfaceTypes(paramedType);
        if (tmpl != null) {
            return tmpl;
        }

        tmpl = lookupGenericSuperclasses(paramedType);
        if (tmpl != null) {
            return tmpl;
        }

        return null;
    }