DocIdSetCardinality implements Cloneable, Comparable<DocIdSetCardinality> { public void orWith(DocIdSetCardinality other) { min = Math.max(min, other.min); max = Math.min(1.0, max + other.max); } DocIdSetCardinality(double minCardinality, double maxCardinality); static DocIdSetCardinality zero(); static DocIdSetCardinality one(); static DocIdSetCardinality random(); static DocIdSetCardinality exact(double cardinality); static DocIdSetCardinality exact(int count, int outOf); static DocIdSetCardinality exactRange(double min, double max); static DocIdSetCardinality exactRange(int min, int max, int outOf); void andWith(DocIdSetCardinality other); void orWith(DocIdSetCardinality other); void invert(); boolean isOne(); boolean isZero(); boolean isRandom(); @Override String toString(); @Override DocIdSetCardinality clone(); @Override int compareTo(DocIdSetCardinality o);  }
@Test public void testOrs() { DocIdSetCardinality c; c = new DocIdSetCardinality(0.1, 0.2); c.orWith(new DocIdSetCardinality(0.1, 0.2)); DocSetAssertions.assertRange(0.1, 0.4, c); c = new DocIdSetCardinality(0.8, 0.9); c.orWith(new DocIdSetCardinality(0.8, 0.9)); DocSetAssertions.assertRange(0.8, 1.0, c); }