@Test void testPositionReportsLowestSegment() { MergedTrackingToken merged = new MergedTrackingToken(token(4), token(3)); assertEquals(3L, merged.position().orElse(0L)); }
@Override public OptionalLong position() { if (lowerSegmentToken.position().isPresent() && upperSegmentToken.position().isPresent()) { return OptionalLong.of(Math.min(lowerSegmentToken.position().getAsLong(), upperSegmentToken.position().getAsLong())); } return OptionalLong.empty(); }
MergedTrackingToken implements TrackingToken, Serializable, WrappedToken { @Override public OptionalLong position() { if (lowerSegmentToken.position().isPresent() && upperSegmentToken.position().isPresent()) { return OptionalLong.of(Math.min(lowerSegmentToken.position().getAsLong(), upperSegmentToken.position().getAsLong())); } return OptionalLong.empty(); } }
MergedTrackingToken implements TrackingToken, Serializable, WrappedToken { @Override public OptionalLong position() { if (lowerSegmentToken.position().isPresent() && upperSegmentToken.position().isPresent()) { return OptionalLong.of(Math.min(lowerSegmentToken.position().getAsLong(), upperSegmentToken.position().getAsLong())); } return OptionalLong.empty(); } @JsonCreator @ConstructorProperties({"lowerSegmentToken", "upperSegmentToken"})  MergedTrackingToken(
            @JsonProperty("lowerSegmentToken") TrackingToken lowerSegmentToken,
            @JsonProperty("upperSegmentToken") TrackingToken upperSegmentToken); protected  MergedTrackingToken(TrackingToken lowerSegmentToken, TrackingToken upperSegmentToken,
                                  boolean lowerSegmentAdvanced, boolean upperSegmentAdvanced); }
MergedTrackingToken implements TrackingToken, Serializable, WrappedToken { @Override public OptionalLong position() { if (lowerSegmentToken.position().isPresent() && upperSegmentToken.position().isPresent()) { return OptionalLong.of(Math.min(lowerSegmentToken.position().getAsLong(), upperSegmentToken.position().getAsLong())); } return OptionalLong.empty(); } @JsonCreator @ConstructorProperties({"lowerSegmentToken", "upperSegmentToken"})  MergedTrackingToken(
            @JsonProperty("lowerSegmentToken") TrackingToken lowerSegmentToken,
            @JsonProperty("upperSegmentToken") TrackingToken upperSegmentToken); protected  MergedTrackingToken(TrackingToken lowerSegmentToken, TrackingToken upperSegmentToken,
                                  boolean lowerSegmentAdvanced, boolean upperSegmentAdvanced); static boolean isMergeInProgress(TrackingToken trackingToken); static OptionalLong mergePosition(TrackingToken trackingToken); @Override TrackingToken lowerBound(TrackingToken other); @Override OptionalLong position(); @Override TrackingToken upperBound(TrackingToken other); @Override boolean covers(TrackingToken other); @Override TrackingToken advancedTo(TrackingToken newToken); @Override Optional<R> unwrap(Class<R> tokenType); @Override TrackingToken lowerBound(); @Override TrackingToken upperBound(); @JsonGetter("lowerSegmentToken") @JsonTypeInfo(use = JsonTypeInfo.Id.MINIMAL_CLASS) TrackingToken lowerSegmentToken(); @JsonGetter("upperSegmentToken") @JsonTypeInfo(use = JsonTypeInfo.Id.MINIMAL_CLASS) TrackingToken upperSegmentToken(); @JsonIgnore boolean isLowerSegmentAdvanced(); @JsonIgnore boolean isUpperSegmentAdvanced(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); }
MergedTrackingToken implements TrackingToken, Serializable, WrappedToken { @Override public OptionalLong position() { if (lowerSegmentToken.position().isPresent() && upperSegmentToken.position().isPresent()) { return OptionalLong.of(Math.min(lowerSegmentToken.position().getAsLong(), upperSegmentToken.position().getAsLong())); } return OptionalLong.empty(); } @JsonCreator @ConstructorProperties({"lowerSegmentToken", "upperSegmentToken"})  MergedTrackingToken(
            @JsonProperty("lowerSegmentToken") TrackingToken lowerSegmentToken,
            @JsonProperty("upperSegmentToken") TrackingToken upperSegmentToken); protected  MergedTrackingToken(TrackingToken lowerSegmentToken, TrackingToken upperSegmentToken,
                                  boolean lowerSegmentAdvanced, boolean upperSegmentAdvanced); static boolean isMergeInProgress(TrackingToken trackingToken); static OptionalLong mergePosition(TrackingToken trackingToken); @Override TrackingToken lowerBound(TrackingToken other); @Override OptionalLong position(); @Override TrackingToken upperBound(TrackingToken other); @Override boolean covers(TrackingToken other); @Override TrackingToken advancedTo(TrackingToken newToken); @Override Optional<R> unwrap(Class<R> tokenType); @Override TrackingToken lowerBound(); @Override TrackingToken upperBound(); @JsonGetter("lowerSegmentToken") @JsonTypeInfo(use = JsonTypeInfo.Id.MINIMAL_CLASS) TrackingToken lowerSegmentToken(); @JsonGetter("upperSegmentToken") @JsonTypeInfo(use = JsonTypeInfo.Id.MINIMAL_CLASS) TrackingToken upperSegmentToken(); @JsonIgnore boolean isLowerSegmentAdvanced(); @JsonIgnore boolean isUpperSegmentAdvanced(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }