AbstractServerStream extends AbstractStream<IdT> implements ServerStream { public final void setListener(ServerStreamListener listener) { this.listener = checkNotNull(listener); onStreamAllocated(); } protected  AbstractServerStream(WritableBufferAllocator bufferAllocator,
                                 int maxMessageSize); final void setListener(ServerStreamListener listener); @Override final void writeHeaders(Metadata headers); @Override final void writeMessage(InputStream message); @Override final void close(Status status, Metadata trailers); void inboundDataReceived(ReadableBuffer frame, boolean endOfStream); void complete(); final void abortStream(Status status, boolean notifyClient); @Override boolean isClosed(); @Override Attributes attributes();  }
@Test public void setListener_setOnlyOnce() { defaultStream.setListener(new ServerStreamListenerBase()); thrown.expect(IllegalStateException.class); defaultStream.setListener(new ServerStreamListenerBase()); }
@Test public void setListener_readyCalled() { ServerStreamListener streamListener = mock(ServerStreamListener.class); defaultStream.setListener(streamListener); verify(streamListener).onReady(); }
@Test public void setListener_failsOnNull() { thrown.expect(NullPointerException.class); defaultStream.setListener(null); }