@Test void testCovers() { GlobalSequenceTrackingToken token1 = new GlobalSequenceTrackingToken(1L); GlobalSequenceTrackingToken token2 = new GlobalSequenceTrackingToken(2L); assertFalse(token1.covers(token2)); assertTrue(token2.covers(token1)); assertTrue(token2.covers(token2)); assertTrue(token2.covers(null)); }
@Override public boolean covers(TrackingToken other) { Assert.isTrue(other == null || other instanceof GlobalSequenceTrackingToken, () -> "Incompatible token type provided:" + other.getClass().getSimpleName()); GlobalSequenceTrackingToken otherToken = (GlobalSequenceTrackingToken) other; return otherToken == null || otherToken.globalIndex <= this.globalIndex; }
GlobalSequenceTrackingToken implements TrackingToken, Comparable<GlobalSequenceTrackingToken>,
                                                    Serializable { @Override public boolean covers(TrackingToken other) { Assert.isTrue(other == null || other instanceof GlobalSequenceTrackingToken, () -> "Incompatible token type provided:" + other.getClass().getSimpleName()); GlobalSequenceTrackingToken otherToken = (GlobalSequenceTrackingToken) other; return otherToken == null || otherToken.globalIndex <= this.globalIndex; } }
GlobalSequenceTrackingToken implements TrackingToken, Comparable<GlobalSequenceTrackingToken>,
                                                    Serializable { @Override public boolean covers(TrackingToken other) { Assert.isTrue(other == null || other instanceof GlobalSequenceTrackingToken, () -> "Incompatible token type provided:" + other.getClass().getSimpleName()); GlobalSequenceTrackingToken otherToken = (GlobalSequenceTrackingToken) other; return otherToken == null || otherToken.globalIndex <= this.globalIndex; } @JsonCreator @ConstructorProperties({"globalIndex"})  GlobalSequenceTrackingToken(@JsonProperty("globalIndex") long globalIndex); }
GlobalSequenceTrackingToken implements TrackingToken, Comparable<GlobalSequenceTrackingToken>,
                                                    Serializable { @Override public boolean covers(TrackingToken other) { Assert.isTrue(other == null || other instanceof GlobalSequenceTrackingToken, () -> "Incompatible token type provided:" + other.getClass().getSimpleName()); GlobalSequenceTrackingToken otherToken = (GlobalSequenceTrackingToken) other; return otherToken == null || otherToken.globalIndex <= this.globalIndex; } @JsonCreator @ConstructorProperties({"globalIndex"})  GlobalSequenceTrackingToken(@JsonProperty("globalIndex") long globalIndex); long getGlobalIndex(); GlobalSequenceTrackingToken offsetBy(int offset); GlobalSequenceTrackingToken next(); @Override TrackingToken lowerBound(TrackingToken other); @Override TrackingToken upperBound(TrackingToken other); @Override boolean covers(TrackingToken other); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); @Override int compareTo(GlobalSequenceTrackingToken o); @Override OptionalLong position(); }
GlobalSequenceTrackingToken implements TrackingToken, Comparable<GlobalSequenceTrackingToken>,
                                                    Serializable { @Override public boolean covers(TrackingToken other) { Assert.isTrue(other == null || other instanceof GlobalSequenceTrackingToken, () -> "Incompatible token type provided:" + other.getClass().getSimpleName()); GlobalSequenceTrackingToken otherToken = (GlobalSequenceTrackingToken) other; return otherToken == null || otherToken.globalIndex <= this.globalIndex; } @JsonCreator @ConstructorProperties({"globalIndex"})  GlobalSequenceTrackingToken(@JsonProperty("globalIndex") long globalIndex); long getGlobalIndex(); GlobalSequenceTrackingToken offsetBy(int offset); GlobalSequenceTrackingToken next(); @Override TrackingToken lowerBound(TrackingToken other); @Override TrackingToken upperBound(TrackingToken other); @Override boolean covers(TrackingToken other); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); @Override int compareTo(GlobalSequenceTrackingToken o); @Override OptionalLong position();  }