### Question:
ProvisioningScreensServiceImpl implements ProvisioningScreensService { @Override public boolean hasRuntimes(final ProviderKey providerKey) { checkNotNull("providerKey", providerKey); return !runtimeService.getRuntimeItems(providerKey).isEmpty(); } 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 testHasRuntimesTrue() { Collection<RuntimeListItem> runtimes = mock(Collection.class); when(runtimeService.getRuntimeItems(providerKey)).thenReturn(runtimes); when(runtimes.isEmpty()).thenReturn(false); assertTrue(service.hasRuntimes(providerKey)); verify(runtimeService, times(1)).getRuntimeItems(providerKey); }
@Test public void testHasRuntimesFalse() { Collection<RuntimeListItem> runtimes = mock(Collection.class); when(runtimeService.getRuntimeItems(providerKey)).thenReturn(runtimes); when(runtimes.isEmpty()).thenReturn(true); assertFalse(service.hasRuntimes(providerKey)); verify(runtimeService, times(1)).getRuntimeItems(providerKey); }