title: How to unit test grpc-java server implementation functions?
body: <p>I have an implementation of GRPC-java server code, but I didn't find the example code to unit test the StreamObserver. Does anyone know the right way to unit test the function?</p>
  
  <pre><code>public class RpcTrackDataServiceImpl implements TrackDataServiceGrpc.TrackDataService {
      @Override
      public void getTracks(GetTracksRequest request, StreamObserver &lt; GetTracksResponse &gt; responseObserver) {
          GetTracksResponse reply = GetTracksResponse
              .newBuilder()
              .addTracks(TrackInfo.newBuilder()
                  .setOwner("test")
                  .setTrackName("test")
                  .build())
              .build();
          responseObserver.onNext(reply);
          responseObserver.onCompleted();
      }
  }
  </code></pre>