### Question:
ProvisioningScreensServiceImpl implements ProvisioningScreensService { @Override public ProvidersInfo getProvidersInfo(final ProviderTypeKey providerTypeKey) { checkNotNull("providerTypeKey", providerTypeKey); final ProviderType providerType = providerTypeService.getProviderType(providerTypeKey); if (providerType == null) { return null; } final Collection<ProviderKey> providersKey = providerService.getProvidersKey(providerType); return new ProvidersInfo(providerType, providersKey); } ProvisioningScreensServiceImpl(); @Inject  ProvisioningScreensServiceImpl(final ProviderTypeService providerTypeService,
                                          final ProviderService providerService,
                                          final RuntimeService runtimeService); @Override ProvidersInfo getProvidersInfo(final ProviderTypeKey providerTypeKey); @Override RuntimesInfo getRuntimesInfo(final ProviderKey providerKey); @Override boolean hasRuntimes(final ProviderKey providerKey);  }### Answer:
@Test public void testGetProvidersInfoProviderTypeExisting() { when(providerTypeService.getProviderType(providerTypeKey)).thenReturn(providerType); when(providerService.getProvidersKey(providerType)).thenReturn(providerKeys); ProvidersInfo providersInfo = service.getProvidersInfo(providerTypeKey); assertNotNull(providersInfo); assertEquals(providerType, providersInfo.getProviderType()); assertEquals(providerKeys, providersInfo.getProvidersKey()); verify(providerTypeService, times(1)).getProviderType(providerTypeKey); verify(providerService, times(1)).getProvidersKey(providerType); }
@Test public void testGetProvidersInfoProviderTypeNotExisting() { when(providerTypeService.getProviderType(providerTypeKey)).thenReturn(null); ProvidersInfo providersInfo = service.getProvidersInfo(providerTypeKey); assertNull(providersInfo); verify(providerTypeService, times(1)).getProviderType(providerTypeKey); verify(providerService, never()).getProvidersKey(providerType); }