AnyMapAdapter { public static <I, O> List<O> adaptList(Class<? extends I> type, List<I> list) { return getInstance().mapList(type, list); } AnyMapAdapter(); static O adapt(I object); static List<O> adaptList(Class<? extends I> type, List<I> list); void registerMapper(Class<? extends I> inputClass, Mapper<I, ?> mapper); O map(I object); List<O> mapList(Class<? extends I> type, List<I> input);  }
@Test public void testAdaptList() throws Exception { AnyMapAdapter adapter = new AnyMapAdapter(); Mapper<Input, ?> mapper = mock(Mapper.class); adapter.registerMapper(Input.class, mapper); List<Input> inputList = asList( new Input(), new Input() ); adapter.mapList(Input.class, inputList); verify(mapper, times(inputList.size())).map(any(Input.class)); }