@Test
public void testBindServiceContainsAllMethods() throws Exception {

  ManagedChannel channel = InProcessChannelBuilder.forName("NetworkServiceProxyTest").build();
  NetworkServiceProxy proxy = new NetworkServiceProxy(channel);
  ServerServiceDefinition serverDefinition = proxy.getServiceDefinition();
  Collection<MethodDescriptor<?, ?>> allMethods = NetworkServiceGrpc.getServiceDescriptor().getMethods();
  Set<MethodDescriptor<?, ?>> definedMethods =
    serverDefinition.getMethods().stream().map(method -> method.getMethodDescriptor()).collect(Collectors.toSet());
  assertThat(definedMethods.size()).isEqualTo(allMethods.size());
  definedMethods.containsAll(allMethods);
}