public static Collection<Method> getDeclaredMethods(Class<?> clazz) {
        Reference<Collection<Method>> ref = declaredMethods.get(clazz);
        Collection<Method> list;
        if (ref != null) {
            list = ref.get();
            if (list != null)
                return list;
        }
        Map<Signature, Method> signatureMethod = new LinkedHashMap<Signature, Method>();
        while (clazz != null) {
            Method[] methods = clazz.isInterface() ? clazz.getMethods() : clazz.getDeclaredMethods();
            for (Method method : methods) {
                Signature signature = new Signature(method);
                if (method.isSynthetic() || method.isBridge() || signatureMethod.containsKey(signature))
                    continue;
                signatureMethod.put(signature, method);
            }
            clazz = clazz.getSuperclass();
        }
        declaredMethods.put(clazz, new WeakReference<Collection<Method>>(list = signatureMethod.values()));
        return list;
    }