### Question:
ProviderTypeServiceImpl implements ProviderTypeService { @Override public Collection<ProviderType> getEnabledProviderTypes() { return getProviderTypesStatus().entrySet().stream() .filter(entry -> ProviderTypeStatus.ENABLED.equals(entry.getValue())) .map(Map.Entry::getKey) .collect(Collectors.toList()); } ProviderTypeServiceImpl(); @Inject  ProviderTypeServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
                                   final ProvisioningPreferences provisioningPreferences,
                                   final PreferenceScopeFactory scopeFactory); @Override Collection<ProviderType> getAvailableProviderTypes(); @Override ProviderType getProviderType(final ProviderTypeKey providerTypeKey); @Override Collection<ProviderType> getEnabledProviderTypes(); @Override void enableProviderTypes(final Collection<ProviderType> providerTypes); @Override void disableProviderType(final ProviderType providerType); @Override Map<ProviderType, ProviderTypeStatus> getProviderTypesStatus();  }### Answer:
@Test public void testGetEnabledProviderTypes() { pickSomeProviders(); pickedProviderTypes.forEach(providerType -> provisioningPreferences.getProviderTypeEnablements().put(providerType, Boolean.TRUE)); Collection<ProviderType> result = service.getEnabledProviderTypes(); assertEquals(pickedProviderTypes.size(), result.size()); pickedProviderTypes.forEach(providerType -> assertTrue(result.contains(providerType))); verify(provisioningPreferences, times(1)).load(); }