ServerCallImpl extends ServerCall<RespT> { @Override public void close(Status status, Metadata trailers) { checkState(!closeCalled, "call already closed"); closeCalled = true; inboundHeaders = null; stream.close(status, trailers); } ServerCallImpl(ServerStream stream, MethodDescriptor<ReqT, RespT> method,
      Metadata inboundHeaders, Context.CancellableContext context,
      DecompressorRegistry decompressorRegistry, CompressorRegistry compressorRegistry); @Override void request(int numMessages); @Override void sendHeaders(Metadata headers); @Override void sendMessage(RespT message); @Override void setMessageCompression(boolean enable); @Override void setCompression(String compressorName); @Override boolean isReady(); @Override void close(Status status, Metadata trailers); @Override boolean isCancelled(); @Override Attributes attributes();  }
@Test public void streamListener_messageRead_unaryFailsOnMultiple() { ServerStreamListenerImpl<Long> streamListener = new ServerCallImpl.ServerStreamListenerImpl<Long>(call, callListener, context); streamListener.messageRead(method.streamRequest(1234L)); streamListener.messageRead(method.streamRequest(1234L)); verify(callListener).onMessage(1234L); verify(stream).close(statusCaptor.capture(), Mockito.isA(Metadata.class)); assertEquals(Status.Code.INTERNAL, statusCaptor.getValue().getCode()); }