@VisibleForTesting
  AccessType extractAccessType(Method endpointMethod) {
    if (endpointMethod.isAnnotationPresent(Authenticate.class)) {
      return endpointMethod.getAnnotation(Authenticate.class).value();
    } else {
      // heuristically infer access type via javax.ws.rs annotations
      if (endpointMethod.getAnnotation(POST.class) != null) {
        return AccessType.CREATE;
      } else if (endpointMethod.getAnnotation(PUT.class) != null) {
        return AccessType.UPDATE;
      } else if (endpointMethod.getAnnotation(DELETE.class) != null) {
        return AccessType.DELETE;
      }
    }

    return AccessType.READ;
  }
@Test
  public void testExtractAccessTypeWithMissingAuthAnnotation() throws Exception {
    Method method = AuthenticationFilterTest.class.getMethod("methodWithGet");
    assertEquals(AccessType.READ, _authFilter.extractAccessType(method));
    method = AuthenticationFilterTest.class.getMethod("methodWithPost");
    assertEquals(AccessType.CREATE, _authFilter.extractAccessType(method));
    method = AuthenticationFilterTest.class.getMethod("methodWithPut");
    assertEquals(AccessType.UPDATE, _authFilter.extractAccessType(method));
    method = AuthenticationFilterTest.class.getMethod("methodWithDelete");
    assertEquals(AccessType.DELETE, _authFilter.extractAccessType(method));
  }