@Test
public void invokesMethodWithNullEntityParameterWhenEntityStreamDoesNotPresent() throws Exception {

    when(applicationContext.getContainerRequest().getEntityStream()).thenReturn(null);
    when(resourceMethod.getMethodParameters()).thenReturn(newArrayList(entityParameter));
    Object invocationResult = methodInvoker.invokeMethod(new EchoResource(), resourceMethod, applicationContext);
    assertEquals(null, invocationResult);
}