}
private HttpMethod getHttpMethod(Method method) {
// search if any of the annotations is annotated with HttpMethod
// such as @GET
HttpMethod httpMethod = null;
for (Annotation annotation : method.getAnnotations()) {
HttpMethod httpMethodCurr = annotation.annotationType().getAnnotation(HttpMethod.class);
if (httpMethodCurr != null) {
if (httpMethod != null) {
throw new IllegalStateException(String
.format("Multiple http method annotations on method %s in class %s", method
.getName(), method.getDeclaringClass().getCanonicalName()));