### Question:
AmbariServerConfigurationProvider implements Provider<T> { protected Map<String, String> toProperties(Collection<AmbariConfigurationEntity> configurationEntities) { Map<String, String> map = new HashMap<>(); if (configurationEntities != null) { for (AmbariConfigurationEntity entity : configurationEntities) { map.put(entity.getPropertyName(), entity.getPropertyValue()); } } return map; } protected  AmbariServerConfigurationProvider(AmbariServerConfigurationCategory configurationCategory, AmbariEventPublisher publisher, GuiceJpaInitializer guiceJpaInitializer); @Subscribe void ambariConfigurationChanged(AmbariConfigurationChangedEvent event); @Subscribe void jpaInitialized(JpaInitializedEvent event); @Override T get();  }### Answer:
@Test public void testToProperties() { Injector injector = getInjector(); AmbariEventPublisher publisher = injector.getInstance(AmbariEventPublisher.class); GuiceJpaInitializer jpaInitializer = injector.getInstance(GuiceJpaInitializer.class); AmbariServerConfigurationProvider provider = createMockBuilder(AmbariServerConfigurationProvider.class) .withConstructor(TEST_CONFIGURATION, publisher, jpaInitializer) .createMock(); replayAll(); Map actualProperties; actualProperties = provider.toProperties(null); Assert.assertNotNull(actualProperties); Assert.assertEquals(Collections.emptyMap(), actualProperties); actualProperties = provider.toProperties(Collections.emptyList()); Assert.assertNotNull(actualProperties); Assert.assertEquals(Collections.emptyMap(), actualProperties); Map<String, String> expectedProperties = new HashMap<>(); expectedProperties.put("one", "1"); expectedProperties.put("two", "2"); expectedProperties.put("three", "3"); actualProperties = provider.toProperties(createAmbariConfigurationEntities(expectedProperties)); Assert.assertNotNull(actualProperties); Assert.assertNotSame(expectedProperties, actualProperties); Assert.assertEquals(expectedProperties, actualProperties); verifyAll(); }