### Question:
ProviderTypeServiceImpl implements ProviderTypeService { @Override public ProviderType getProviderType(final ProviderTypeKey providerTypeKey) { checkNotNull("providerTypeKey", providerTypeKey); return getAvailableProviderTypes().stream() .filter(providerType -> providerType.getKey().equals(providerTypeKey)) .findFirst().orElse(null); } 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 testGetProviderTypeExisting() { org.guvnor.ala.runtime.providers.ProviderType providerTypeSpi = providerTypesSpi.get(2); ProviderTypeKey providerTypeKey = new ProviderTypeKey(providerTypeSpi.getProviderTypeName(), providerTypeSpi.getVersion()); ProviderType providerType = service.getProviderType(providerTypeKey); assertNotNull(providerType); assertEquals(providerTypeSpi.getProviderTypeName(), providerType.getKey().getId()); assertEquals(providerTypeSpi.getVersion(), providerType.getKey().getVersion()); }
@Test public void testGetProviderTypeNotExisting() { ProviderTypeKey providerTypeKey = new ProviderTypeKey("NonExisting", "NonExisting"); ProviderType providerType = service.getProviderType(providerTypeKey); assertNull(providerType); }