ResultSets { public static Future<List<ResultSet>> queryAllAsList(Session session, String query, Object... partitionKeys) { List<ResultSetFuture> futures = sendQueries(session, query, partitionKeys); return Futures.successfulAsList(futures); }  static Future<List<ResultSet>> queryAllAsList(Session session, String query, Object... partitionKeys); static List<ListenableFuture<ResultSet>> queryAll(Session session, String query, Object... partitionKeys); static Observable<ResultSet> queryAllAsObservable(Session session, String query, Object... partitionKeys);  }
@Test public void should_query_partitions_as_list() throws Exception { Future<List<ResultSet>> future = ResultSets.queryAllAsList(session, "SELECT * FROM users WHERE id = ?", uuids); for (ResultSet rs : future.get()) { } List<String> names = Lists.transform(future.get(100, MILLISECONDS), (ResultSet rs) -> rs.one().getString("name")); Assertions.assertThat(names).containsOnly("user1", "user2", "user3", "user4", "user5"); }