All extends SimpleQuery<O, O> { public All(Class<O> objectType) { super(new SelfAttribute<O>(checkObjectTypeNotNull(objectType), "all")); this.objectType = objectType; } All(Class<O> objectType); @Override boolean equals(Object o); @Override String toString();  }
@Test public void testAll() { IndexedCollection<Integer> indexedCollection = new ConcurrentIndexedCollection<Integer>(); indexedCollection.addAll(asList(1, 2, 3, 4, 5)); IndexedCollection<Integer> collection = indexedCollection; Query<Integer> query = all(Integer.class); ResultSet<Integer> results = collection.retrieve(query); assertEquals(5, results.size()); assertTrue(results.iterator().hasNext()); }
@Test public void testAllAnd() { IndexedCollection<Integer> indexedCollection = new ConcurrentIndexedCollection<Integer>(); indexedCollection.addAll(asList(1, 2, 3, 4, 5)); IndexedCollection<Integer> collection = indexedCollection; final And<Integer> query = and( all(Integer.class), lessThan(selfAttribute(Integer.class), 3) ); ResultSet<Integer> results = collection.retrieve(query); assertEquals(2, results.size()); assertTrue(results.iterator().hasNext()); }
@Test public void testAllOr() { IndexedCollection<Integer> indexedCollection = new ConcurrentIndexedCollection<Integer>(); indexedCollection.addAll(asList(1, 2, 3, 4, 5)); IndexedCollection<Integer> collection = indexedCollection; final Or<Integer> query = or( all(Integer.class), lessThan(selfAttribute(Integer.class), 3) ); ResultSet<Integer> results = collection.retrieve(query, queryOptions(deduplicate(LOGICAL_ELIMINATION))); assertEquals(5, results.size()); assertTrue(results.iterator().hasNext()); }