@Override public CommunityHalfExpr toCommunityHalfExpr() { return new RangeCommunityHalf(_range); } }
@JsonCreator private static @Nonnull RangeCommunityHalf create(@JsonProperty(PROP_RANGE) SubRange range) { return new RangeCommunityHalf(requireNonNull(range)); }
@Test public void testMatches() { RangeCommunityHalf l = new RangeCommunityHalf(new SubRange(1, 3)); assertThat(l, matches(1)); assertThat(l, matches(2)); assertThat(l, matches(3)); assertThat(l, not(matches(0))); assertThat(l, not(matches(4))); } }
@Test public void testEquals() { new EqualsTester() .addEqualityGroup( new RangeCommunityHalf(new SubRange(1, 2)), new RangeCommunityHalf(new SubRange(1, 2))) .addEqualityGroup(new RangeCommunityHalf(new SubRange(1, 3))) .testEquals(); }