### Question:
RuntimeServiceImpl implements RuntimeService { @Override public Collection<RuntimeListItem> getRuntimeItems(final ProviderKey providerKey) { checkNotNull("providerKey", providerKey); final RuntimeQuery query = RuntimeQueryBuilder.newInstance() .withProviderId(providerKey.getId()) .build(); return buildRuntimeQueryResult(runtimeProvisioningService.executeQuery(query)); } RuntimeServiceImpl(); @Inject  RuntimeServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
                              final PipelineServiceBackend pipelineService,
                              final ProviderService providerService,
                              final Event<RuntimeChangeEvent> runtimeChangeEvent,
                              final Event<PipelineExecutionChangeEvent> pipelineExecutionChangeEvent); @Override Collection<RuntimeListItem> getRuntimeItems(final ProviderKey providerKey); @Override RuntimeListItem getRuntimeItem(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override RuntimeListItem getRuntimeItem(final RuntimeKey runtimeKey); @Override Collection<PipelineKey> getPipelines(final ProviderTypeKey providerTypeKey); @Override PipelineExecutionTraceKey createRuntime(final ProviderKey providerKey,
                                                   final String runtimeName,
                                                   final PipelineKey pipelineKey,
                                                   final Map<String, String> params); @Override void stopPipelineExecution(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override void deletePipelineExecution(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override void stopRuntime(final RuntimeKey runtimeKey); @Override void startRuntime(final RuntimeKey runtimeKey); @Override void deleteRuntime(final RuntimeKey runtimeKey,
                              final boolean forced);  }### Answer:
@Test public void testGetRuntimeItems() { ProviderTypeKey providerTypeKey = new ProviderTypeKey(PROVIDER_NAME, PROVIDER_VERSION); ProviderKey providerKey = new ProviderKey(providerTypeKey, PROVIDER_ID); when(runtimeProvisioningService.executeQuery(any(RuntimeQuery.class))).thenReturn(queryItems); Collection<RuntimeListItem> result = service.getRuntimeItems(providerKey); Collection<RuntimeListItem> expectedResult = buildExpectedResult(queryItems); assertEquals(expectedResult, result); }