### Question:
CachingExpanderRegistry implements ExpanderRegistry { @Override public ExpressionExpander getExpanderByType(Class<?> parameterType) { return this.expanderMapCache.computeIfAbsent(parameterType, type -> { if (Iterable.class.isAssignableFrom(type)) { return ListExpander.getInstance(); } else if (Map.class.isAssignableFrom(type)) { return MapExpander.getInstance(); } else if (ExpanderUtils.isSimpleType(type)) { return SimpleExpander.getInstance(); } else { return BeanExpander.getInstance(this); } }); }  @Override ExpressionExpander getExpanderByType(Class<?> parameterType); @Override ExpressionExpander getExpander(Class<? extends ExpressionExpander> expanderClass);  }### Answer:
@Test void map_shouldBeExpandedWith_MapExpander() { assertThat(this.expanderRegistry.getExpanderByType(Map.class)).isInstanceOf(MapExpander.class); }
@Test void list_shouldBeExpandedWith_ListExpander() { assertThat(this.expanderRegistry.getExpanderByType(List.class)) .isInstanceOf(ListExpander.class); }
@Test void simpleTypes_shouldBeExpandedWith_SimpleExpander() { assertThat(this.expanderRegistry.getExpanderByType(String.class)) .isInstanceOf(SimpleExpander.class); }
@Test void complexType_shouldBeExpandedWith_BeanExpander() { assertThat(this.expanderRegistry.getExpanderByType(SimpleExpander.class)) .isInstanceOf(BeanExpander.class); }
@Test void expanderInstances_shouldBeReused() { ExpressionExpander expander = expanderRegistry.getExpanderByType(String.class); assertThat(expander).isEqualTo(expanderRegistry.getExpanderByType(String.class)); }