### Question:
CachingExpanderRegistry implements ExpanderRegistry { @Override public ExpressionExpander getExpander(Class<? extends ExpressionExpander> expanderClass) { return this.expanderMapCache.computeIfAbsent(expanderClass, type -> { try { return (ExpressionExpander) type.getDeclaredConstructor().newInstance(); } catch (Exception ex) { throw new IllegalStateException("Error occurred creating custom expander instance " + "for type " + type.getSimpleName() + ". " + "Could not create instance." + ex.getMessage(), ex); } }); }  @Override ExpressionExpander getExpanderByType(Class<?> parameterType); @Override ExpressionExpander getExpander(Class<? extends ExpressionExpander> expanderClass);  }### Answer:
@Test void customExpanderTypes_mustHaveDefaultConstructor() { assertThrows(IllegalStateException.class, () -> this.expanderRegistry.getExpander(InvalidExpander.class)); }
@Test void customExpanderTypes_shouldBeInstantiated() { ExpressionExpander expander = this.expanderRegistry.getExpander(CustomExpander.class); assertThat(expander).isNotNull().isInstanceOf(CustomExpander.class); }
@Test void customExpanderTypes_shouldBeReused() { ExpressionExpander expander = this.expanderRegistry.getExpander(CustomExpander.class); assertThat(expander).isEqualTo(this.expanderRegistry.getExpander(CustomExpander.class)); }