@Test void testRegister() { ExceptionResponseGenerator exceptionResponseGenerator = mock(ExceptionResponseGenerator.class); ApplicationContext applicationContext = mock(ApplicationContext.class); when(applicationContext.getBeansOfType(ExceptionResponseGenerator.class)) .thenReturn(singletonMap("exceptionResponseGenerator", exceptionResponseGenerator)); exceptionResponseGeneratorRegistrar.register(applicationContext); verify(exceptionResponseGeneratorRegistry) .registerExceptionResponseGenerator(exceptionResponseGenerator); }
public void register(ApplicationContext applicationContext) { Map<String, ExceptionResponseGenerator> responseGeneratorMap = applicationContext.getBeansOfType(ExceptionResponseGenerator.class); responseGeneratorMap.values().forEach(this::registerResponseGenerator); }
ExceptionResponseGeneratorRegistrar { public void register(ApplicationContext applicationContext) { Map<String, ExceptionResponseGenerator> responseGeneratorMap = applicationContext.getBeansOfType(ExceptionResponseGenerator.class); responseGeneratorMap.values().forEach(this::registerResponseGenerator); } }
ExceptionResponseGeneratorRegistrar { public void register(ApplicationContext applicationContext) { Map<String, ExceptionResponseGenerator> responseGeneratorMap = applicationContext.getBeansOfType(ExceptionResponseGenerator.class); responseGeneratorMap.values().forEach(this::registerResponseGenerator); } ExceptionResponseGeneratorRegistrar(
      ExceptionResponseGeneratorRegistry responseGeneratorRegistry); }
ExceptionResponseGeneratorRegistrar { public void register(ApplicationContext applicationContext) { Map<String, ExceptionResponseGenerator> responseGeneratorMap = applicationContext.getBeansOfType(ExceptionResponseGenerator.class); responseGeneratorMap.values().forEach(this::registerResponseGenerator); } ExceptionResponseGeneratorRegistrar(
      ExceptionResponseGeneratorRegistry responseGeneratorRegistry); void register(ApplicationContext applicationContext); }
ExceptionResponseGeneratorRegistrar { public void register(ApplicationContext applicationContext) { Map<String, ExceptionResponseGenerator> responseGeneratorMap = applicationContext.getBeansOfType(ExceptionResponseGenerator.class); responseGeneratorMap.values().forEach(this::registerResponseGenerator); } ExceptionResponseGeneratorRegistrar(
      ExceptionResponseGeneratorRegistry responseGeneratorRegistry); void register(ApplicationContext applicationContext);  }