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