@Test public void When_Support_Type_Retrieved_Then_Is_The_Same_as_The_Type_Of_The_Param() throws NoSuchMethodException { Method method = Providers.class.getDeclaredMethod("checkCustomObject", Model.class); Optional annotation = (Optional) method.getParameterAnnotations()[0][0]; Type type = method.getGenericParameterTypes()[0]; Metadata<Optional> metadata = new Metadata<>(Providers.class, method, null, annotation, type); Type[] supportedTypes = optionalMockery.supportedTypes(metadata); assertThat(supportedTypes.length, is(1)); assertTrue(Arrays.asList(supportedTypes).contains(Model.class)); }