@Test public void When_Support_Type_Retrieved_Then_Is_Request_Body() throws NoSuchMethodException { Method method = Providers.class.getDeclaredMethod("string", String.class); RequestBodyValid annotation = (RequestBodyValid) method.getParameterAnnotations()[0][0]; Type type = method.getGenericParameterTypes()[0]; Metadata<RequestBodyValid> metadata = new Metadata<>(Providers.class, method, null, annotation, type); Type[] types = requestBodyValidMockery.supportedTypes(metadata); assertThat(types.length, is(1)); Class clazz = (Class) types[0]; assertEquals(clazz, RequestBody.class); }