### Question:
AbstractLambdaLoggerFactory implements ILambdaLoggerFactory { @Override public LambdaLogger getLogger(String name) { return loggers.computeIfAbsent(name, this::doBuildLambdaLogger); } AbstractLambdaLoggerFactory(ILoggerFactory underlyingLoggerFactory); @Override ILoggerFactory getUnderlyingLoggerFactory(); @Override LambdaLogger getLogger(String name); abstract LambdaLogger buildLambdaLogger(Logger underlyingLogger);  }### Answer:
@Test public void getLogger_different_name_return_different_instances() throws Exception { when(underlyingLoggerFactory.getLogger("hello")).thenReturn(mock(Logger.class)); when(underlyingLoggerFactory.getLogger("world")).thenReturn(mock(Logger.class)); LambdaLogger helloLambdaLogger = abstractlambdaLoggerFactory.getLogger("hello"); LambdaLogger worldLambdaLogger = abstractlambdaLoggerFactory.getLogger("world"); assertThat(helloLambdaLogger, not(sameInstance(worldLambdaLogger))); }
@Test public void getLogger_same_name_return_same_instance() throws Exception { when(underlyingLoggerFactory.getLogger("hello")).thenReturn(mock(Logger.class)); LambdaLogger helloLambdaLogger = abstractlambdaLoggerFactory.getLogger("hello"); LambdaLogger helloLambdaLoggerAgain = abstractlambdaLoggerFactory.getLogger("hello"); assertThat(helloLambdaLogger, sameInstance(helloLambdaLoggerAgain)); }