diff --git a/src/java/com/twitter/search/common/converter/earlybird/BasicIndexingConverter.java b/src/java/com/twitter/search/common/converter/earlybird/BasicIndexingConverter.java index 2cfc3b986..5966805a5 100644 --- a/src/java/com/twitter/search/common/converter/earlybird/BasicIndexingConverter.java +++ b/src/java/com/twitter/search/common/converter/earlybird/BasicIndexingConverter.java @@ -560,10 +560,11 @@ public class BasicIndexingConverter { long inReplyToUserIdVal, boolean strict, EarlybirdThriftDocumentBuilder builder) { - Optional retweetUserId = Optional.of(retweetUserIdVal).filter(id -> id > 0); - Optional sharedStatusId = Optional.of(sharedStatusIdVal).filter(id -> id > 0); - Optional inReplyToUserId = Optional.of(inReplyToUserIdVal).filter(id -> id > 0); - Optional inReplyToStatusId = Optional.of(inReplyToStatusIdVal).filter(id -> id > 0); + Predicate isGreaterThanZero = id -> id > 0; + Optional retweetUserId = Optional.of(retweetUserIdVal).filter(isGreaterThanZero); + Optional sharedStatusId = Optional.of(sharedStatusIdVal).filter(isGreaterThanZero); + Optional inReplyToUserId = Optional.of(inReplyToUserIdVal).filter(isGreaterThanZero); + Optional inReplyToStatusId = Optional.of(inReplyToStatusIdVal).filter(isGreaterThanZero); Preconditions.checkState(retweetUserId.isPresent() == sharedStatusId.isPresent());