RxResultCursorImpl implements RxResultCursor { @Override public CompletionStage<ResultSummary> summaryAsync() { if ( !isDone() && !resultConsumed ) { installRecordConsumer( DISCARD_RECORD_CONSUMER ); cancel(); resultConsumed = true; } return this.summaryFuture; } RxResultCursorImpl(RunResponseHandler runHandler, PullResponseHandler pullHandler );  RxResultCursorImpl(Throwable runError, RunResponseHandler runHandler, PullResponseHandler pullHandler ); @Override List<String> keys(); @Override void installRecordConsumer( BiConsumer<Record,Throwable> recordConsumer ); @Override void request( long n ); @Override void cancel(); @Override CompletionStage<Throwable> discardAllFailureAsync(); @Override CompletionStage<Throwable> pullAllFailureAsync(); @Override CompletionStage<ResultSummary> summaryAsync(); @Override boolean isDone();  }
@Test void shouldAllowToCallSummaryMultipleTimes() throws Throwable { RunResponseHandler runHandler = newRunResponseHandler(); PullResponseHandler pullHandler = new ListBasedPullHandler(); RxResultCursor cursor = new RxResultCursorImpl( runHandler, pullHandler ); cursor.summaryAsync(); cursor.summaryAsync(); cursor.summaryAsync(); }