@Test void singletonCreation_shouldLazyLoad_andReuse() { BeanExpander beanExpander = BeanExpander.getInstance(mock(ExpanderRegistry.class)); assertThat(beanExpander).isNotNull(); BeanExpander another = BeanExpander.getInstance(mock(ExpanderRegistry.class)); assertThat(another).isEqualTo(beanExpander); }
static BeanExpander getInstance(ExpanderRegistry expanderRegistry) { if (instance == null) { instance = new BeanExpander(expanderRegistry); } return instance; }
BeanExpander extends MapExpander { static BeanExpander getInstance(ExpanderRegistry expanderRegistry) { if (instance == null) { instance = new BeanExpander(expanderRegistry); } return instance; } }
BeanExpander extends MapExpander { static BeanExpander getInstance(ExpanderRegistry expanderRegistry) { if (instance == null) { instance = new BeanExpander(expanderRegistry); } return instance; } BeanExpander(ExpanderRegistry expanderRegistry); }
BeanExpander extends MapExpander { static BeanExpander getInstance(ExpanderRegistry expanderRegistry) { if (instance == null) { instance = new BeanExpander(expanderRegistry); } return instance; } BeanExpander(ExpanderRegistry expanderRegistry); @Override String expand(ExpressionVariable variable, Object value); }
BeanExpander extends MapExpander { static BeanExpander getInstance(ExpanderRegistry expanderRegistry) { if (instance == null) { instance = new BeanExpander(expanderRegistry); } return instance; } BeanExpander(ExpanderRegistry expanderRegistry); @Override String expand(ExpressionVariable variable, Object value);  }