private RequestSignatureResolver prepareRequestSignatureResolver(Method requestInterface) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException { for (Annotation annotation : requestInterface.getAnnotations()) { for (Class<?> declaredInterface : annotation.getClass().getInterfaces()) { for (Annotation metaAnnotation : declaredInterface.getAnnotations()) { for (Class<?> declaredMetaInterface : metaAnnotation.getClass().getInterfaces()) { if (declaredMetaInterface == RestMethod.class) { return new RequestSignatureResolver(declaredInterface, annotation); } } } } } throw new NoSuchMethodException(); }