AnyMapAdapter { public <I, O> O map(I object) { if (object == null) { return null; } Mapper<I, O> mapper = findMapper(object.getClass()); return mapper.map(object); } 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(expected = IllegalStateException.class) public void testThrowIfNoMapperRegistered() throws Exception { AnyMapAdapter adapter = new AnyMapAdapter(); Input input = new Input(); adapter.map(input); }