InternalResult implements Result { @Override public List<String> keys() { if ( keys == null ) { blockingGet( cursor.peekAsync() ); keys = cursor.keys(); } return keys; } InternalResult(Connection connection, ResultCursor cursor ); @Override List<String> keys(); @Override boolean hasNext(); @Override Record next(); @Override Record single(); @Override Record peek(); @Override Stream<Record> stream(); @Override List<Record> list(); @Override List<T> list( Function<Record, T> mapFunction ); @Override ResultSummary consume(); @Override void remove();  }
@Test void accessingKeysWithoutCallingNextShouldNotFail() { Result result = createResult( 11 ); assertThat( result.keys(), equalTo( asList( "k1", "k2" ) ) ); }