@Test void customExpanderTypes_shouldBeInstantiated() { ExpressionExpander expander = this.expanderRegistry.getExpander(CustomExpander.class); assertThat(expander).isNotNull().isInstanceOf(CustomExpander.class); }
@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); } }); }
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); } }); } }
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); } }); }  }
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); }
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);  }