### Question:
ConsoleConfigHandlerImpl implements ConsoleConfigHandler { @Override public <C> C getConfig(String realm, Class<? extends ConsoleConfigBuilder<C>> builderType) { try { ConsoleConfigBuilder<C> builder = injector.getInstance(builderType); Map<String, Set<String>> collatedAttributes = getCollatedAttributes(realm, builder); populateAnnotatedMethods(builder, collatedAttributes); return builder.build(collatedAttributes); } catch (IllegalAccessException | InvocationTargetException e) { throw new IllegalArgumentException("Invalid builder or method definition", e); } } @Inject  ConsoleConfigHandlerImpl(SMSConfigProvider configProvider, DNWrapper dnUtils, Injector injector); @Override C getConfig(String realm, Class<? extends ConsoleConfigBuilder<C>> builderType); @Override void registerListener(ConsoleConfigListener listener, Class<? extends ConsoleConfigBuilder<?>> builderType);  }### Answer:
@Test public void beanSuccessfullyPopulatedFromDifferentSources() { given(injector.getInstance(MockBeanBuilder.class)).willReturn(new MockBeanBuilder()); given(configProvider.getAttributes("MockSource", "/")).willReturn(basicAttributes); given(configProvider.getAttributes("MockLocaleSource", "/")).willReturn(localeAttributes); given(injector.getInstance(DefaultConfigTransformer.class)).willReturn(new DefaultConfigTransformer()); given(injector.getInstance(LocaleStringsTransformer.class)).willReturn(new LocaleStringsTransformer()); MockBean bean = consoleConfigHandler.getConfig("/", MockBeanBuilder.class); assertThat(bean.message).isEqualTo("Some message"); assertThat(bean.enabled).isTrue(); assertThat(bean.count).isEqualTo(1234); assertThat(bean.time).isEqualTo(9876543210L); assertThat(bean.currency).isEqualTo(123.456D); assertThat(bean.values).containsExactly("Single value"); assertThat(bean.localeStrings).containsEntry("en", "English message"); assertThat(bean.localeStrings).containsEntry("fr", "French message"); assertThat(bean.additionalLocaleStrings).containsEntry("en_US", "American message"); assertThat(bean.additionalLocaleStrings).containsEntry("de", "German message"); }