@Test void includeShouldBeFalseWhenDifferentOne() { MessageRange range = MessageUid.of(3).toRange(); boolean actual = range.includes(MessageUid.of(1)); assertThat(actual).isFalse(); }
public boolean includes(MessageUid uid) { switch (type) { case ALL: return true; case FROM: if (getUidFrom().compareTo(uid) <= 0) { return true; } return false; case RANGE: if (getUidFrom().compareTo(uid) <= 0 && getUidTo().compareTo(uid) >= 0) { return true; } return false; case ONE: if (getUidFrom().equals(uid)) { return true; } return false; default: return false; } }
MessageRange implements Iterable<MessageUid> { public boolean includes(MessageUid uid) { switch (type) { case ALL: return true; case FROM: if (getUidFrom().compareTo(uid) <= 0) { return true; } return false; case RANGE: if (getUidFrom().compareTo(uid) <= 0 && getUidTo().compareTo(uid) >= 0) { return true; } return false; case ONE: if (getUidFrom().equals(uid)) { return true; } return false; default: return false; } } }
MessageRange implements Iterable<MessageUid> { public boolean includes(MessageUid uid) { switch (type) { case ALL: return true; case FROM: if (getUidFrom().compareTo(uid) <= 0) { return true; } return false; case RANGE: if (getUidFrom().compareTo(uid) <= 0 && getUidTo().compareTo(uid) >= 0) { return true; } return false; case ONE: if (getUidFrom().equals(uid)) { return true; } return false; default: return false; } } protected  MessageRange(Type type, MessageUid minValue, MessageUid maxValue); }
MessageRange implements Iterable<MessageUid> { public boolean includes(MessageUid uid) { switch (type) { case ALL: return true; case FROM: if (getUidFrom().compareTo(uid) <= 0) { return true; } return false; case RANGE: if (getUidFrom().compareTo(uid) <= 0 && getUidTo().compareTo(uid) >= 0) { return true; } return false; case ONE: if (getUidFrom().equals(uid)) { return true; } return false; default: return false; } } protected  MessageRange(Type type, MessageUid minValue, MessageUid maxValue); static MessageRange one(MessageUid uid); static MessageRange all(); static MessageRange range(MessageUid from, MessageUid to); static MessageRange from(MessageUid from); Type getType(); MessageUid getUidFrom(); MessageUid getUidTo(); boolean includes(MessageUid uid); String toString(); static List<MessageRange> toRanges(Collection<MessageUid> uidsCol); @Override Iterator<MessageUid> iterator(); List<MessageRange> split(int maxItems); @Override int hashCode(); @Override boolean equals(Object obj); }
MessageRange implements Iterable<MessageUid> { public boolean includes(MessageUid uid) { switch (type) { case ALL: return true; case FROM: if (getUidFrom().compareTo(uid) <= 0) { return true; } return false; case RANGE: if (getUidFrom().compareTo(uid) <= 0 && getUidTo().compareTo(uid) >= 0) { return true; } return false; case ONE: if (getUidFrom().equals(uid)) { return true; } return false; default: return false; } } protected  MessageRange(Type type, MessageUid minValue, MessageUid maxValue); static MessageRange one(MessageUid uid); static MessageRange all(); static MessageRange range(MessageUid from, MessageUid to); static MessageRange from(MessageUid from); Type getType(); MessageUid getUidFrom(); MessageUid getUidTo(); boolean includes(MessageUid uid); String toString(); static List<MessageRange> toRanges(Collection<MessageUid> uidsCol); @Override Iterator<MessageUid> iterator(); List<MessageRange> split(int maxItems); @Override int hashCode(); @Override boolean equals(Object obj);  }