BufferingPullSubscriber implements PullSubscriber { @Override public void close() { underlying.stopAsync().awaitTerminated(); } BufferingPullSubscriber(SubscriberFactory factory, FlowControlSettings settings);   BufferingPullSubscriber(
      SubscriberFactory factory, FlowControlSettings settings, Offset initialLocation); @Override List<SequencedMessage> pull(); @Override void close();  }
@Test public void closeStops() throws Exception { when(underlying.stopAsync()).thenReturn(underlying); subscriber.close(); verify(underlying).stopAsync(); verify(underlying).awaitTerminated(); }