public ListenableFuture<ListPluginsResponse> listPluginsWithDeadline(
      ListPluginsRequest request, Deadline deadline) {
    return pluginService.withDeadline(deadline).listPlugins(request);
  }
@Test
  public void listPlugins_returnsMultiplePlugins() throws Exception {
    ListPluginsRequest request = ListPluginsRequest.getDefaultInstance();

    List<PluginDefinition> plugins = Lists.newArrayList();
    for (int i = 0; i < 5; i++) {
      plugins.add(createSinglePluginDefinitionWithName(String.format(PLUGIN_NAME + "%d", i)));
    }

    PluginServiceImplBase listPluginsImpl =
        new PluginServiceImplBase() {
          @Override
          public void listPlugins(
              ListPluginsRequest request, StreamObserver<ListPluginsResponse> responseObserver) {
            responseObserver.onNext(
                ListPluginsResponse.newBuilder().addAllPlugins(plugins).build());
            responseObserver.onCompleted();
          }
        };
    serviceRegistry.addService(listPluginsImpl);

    ListenableFuture<ListPluginsResponse> listPlugins =
        pluginService.listPluginsWithDeadline(request, DEADLINE_DEFAULT);

    assertThat(listPlugins.isDone()).isTrue();
    assertThat(listPlugins.get().getPluginsList()).containsExactlyElementsIn(plugins);
  }