ByteKeyRange implements Serializable,
        HasDefaultTracker<
            ByteKeyRange, org.apache.beam.sdk.transforms.splittabledofn.ByteKeyRangeTracker> { @Override public boolean equals(@Nullable Object o) { if (o == this) { return true; } if (!(o instanceof ByteKeyRange)) { return false; } ByteKeyRange other = (ByteKeyRange) o; return Objects.equals(startKey, other.startKey) && Objects.equals(endKey, other.endKey); } private  ByteKeyRange(ByteKey startKey, ByteKey endKey); static ByteKeyRange of(ByteKey startKey, ByteKey endKey); ByteKey getStartKey(); ByteKey getEndKey(); Boolean containsKey(ByteKey key); Boolean overlaps(ByteKeyRange other); List<ByteKey> split(int numSplits); double estimateFractionForKey(ByteKey key); ByteKey interpolateKey(double fraction); ByteKeyRange withStartKey(ByteKey startKey); ByteKeyRange withEndKey(ByteKey endKey); @Override String toString(); @Override boolean equals(@Nullable Object o); @Override int hashCode(); @Override org.apache.beam.sdk.transforms.splittabledofn.ByteKeyRangeTracker newTracker(); static final ByteKeyRange ALL_KEYS; }
@Test public void testEquals() { for (int i = 0; i < TEST_RANGES.length; ++i) { for (int j = 0; j < TEST_RANGES.length; ++j) { ByteKeyRange left = TEST_RANGES[i]; ByteKeyRange right = TEST_RANGES[j]; boolean eq = left.equals(right); if (i == j) { assertTrue(String.format("Expected that %s is equal to itself.", left), eq); assertTrue( String.format("Expected that %s is equal to a copy of itself.", left), left.equals(ByteKeyRange.of(right.getStartKey(), right.getEndKey()))); } else { assertFalse(String.format("Expected that %s is not equal to %s", left, right), eq); } } } }