@Test
public void extractMethod() throws Exception {

  String[][] mm = {
      { "GET", null, null, "GET" },
      { "GET", "xxx", "yyy", "GET" },
      { "PUT", "xxx", "yyy", "PUT" },
      { "DELETE", "xxx", "yyy", "DELETE" },
      { "PATCH", "xxx", "yyy", "PATCH" },
      { "POST", null, null, "POST" },
      { "POST", null, "GET", "GET" },
      { "POST", null, "PATCH", "PATCH" },
      { "POST", "GET", null, "GET" },
      { "POST", "PATCH", null, "PATCH" },
      { "POST", "GET", "GET", "GET" },
      { "HEAD", null, null, "HEAD" }
  };
  for (String[] m : mm) {
    HttpServletRequest hr = mock(HttpServletRequest.class);
    when(hr.getMethod()).thenReturn(m[0]);
    when(hr.getHeader("X-HTTP-Method")).thenReturn(m[1]);
    when(hr.getHeader("X-HTTP-Method-Override")).thenReturn(m[2]);
    assertEquals(HttpMethod.valueOf(m[3]), ODataHttpHandlerImpl.extractMethod(hr));
  }
}