### Question:
RuntimeServiceImpl implements RuntimeService { @Override public Collection<PipelineKey> getPipelines(final ProviderTypeKey providerTypeKey) { checkNotNull("providerTypeKey", providerTypeKey); return pipelineService.getPipelineNames(new org.guvnor.ala.runtime.providers.ProviderType() { @Override public String getProviderTypeName() { return providerTypeKey.getId(); } @Override public String getVersion() { return providerTypeKey.getVersion(); } }, 0, 1000, "name", true ).stream().map(PipelineKey::new).collect(Collectors.toList()); } 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 testGetPipelines() { ProviderTypeKey providerTypeKey = new ProviderTypeKey(PROVIDER_NAME, PROVIDER_VERSION); when(pipelineService.getPipelineNames(any(org.guvnor.ala.runtime.providers.ProviderType.class), anyInt(), anyInt(), anyString(), anyBoolean())).thenReturn(pipelineNames); Collection<PipelineKey> result = service.getPipelines(providerTypeKey); assertEquals(pipelineKeys, result); }