@Test
public void testStream() {

    List<String> input = asList("a", "b", "c", "d");
    IndexedCollection<String> indexedCollection = new ConcurrentIndexedCollection<String>();
    indexedCollection.addAll(input);
    ResultSet<String> resultSet = indexedCollection.retrieve(all(String.class), queryOptions(orderBy(ascending(selfAttribute(String.class)))));
    Stream<String> stream = resultSet.stream();
    List<String> output = stream.collect(toList());
    assertEquals(input, output);
}