@Test
public void testToInvocation() throws Exception {

  final RequestMethod<?> requestMethod = spy(RequestMethod.class);
  final String expected = randomUUID().toString();
  when(requestMethod.runInternal(anyList())).thenReturn(expected);
  final Invocation<?> invocation = requestMethod.toInvocation();
  final Object actual = invocation.invoke();
  assertEquals(expected, actual);
}