public MethodGenericsContext(final GenericsInfo genericsInfo, final Class<?> type, final Method method) {
        super(genericsInfo, type);
        final Class<?> declaringType = method.getDeclaringClass();
        if (!declaringType.equals(type)) {
            throw new IllegalArgumentException(String.format(
                    "Method '%s' should be resolved on type %s and not %s",
                    method.getName(), declaringType.getSimpleName(), type.getSimpleName()));
        }
        this.method = method;
        initGenerics();
    }