@Test public void testComplement() { LongSpace notAllAsNumbers = LONGSPACE1.not(LONGSPACE1); assertTrue("Complement of full space is empty", notAllAsNumbers.isEmpty()); LongSpace portsWithExclusion = LONGSPACE1.toBuilder().excluding(Range.closed(10L, 20L)).build(); assertThat( portsWithExclusion.not(), equalTo(LongSpace.builder().including(Range.closed(10L, 20L)).build())); LongSpace small = _b.including(Range.closed(12L, 15L)).build(); assertThat(portsWithExclusion.not(small), equalTo(small)); assertThat( portsWithExclusion.not(LongSpace.builder().including(Range.closed(40L, 50L)).build()), equalTo(EMPTY)); assertThat(portsWithExclusion.not(EMPTY), equalTo(EMPTY)); assertThat(EMPTY.not(), equalTo(EMPTY)); }
public static @Nonnull Builder builder() { return new Builder(); }
LongSpace extends NumberSpace<Long, LongSpace, LongSpace.Builder> { public static @Nonnull Builder builder() { return new Builder(); } }
LongSpace extends NumberSpace<Long, LongSpace, LongSpace.Builder> { public static @Nonnull Builder builder() { return new Builder(); } protected  LongSpace(RangeSet<Long> rangeset); }
LongSpace extends NumberSpace<Long, LongSpace, LongSpace.Builder> { public static @Nonnull Builder builder() { return new Builder(); } protected  LongSpace(RangeSet<Long> rangeset); static @Nonnull Builder builder(); static @Nonnull LongSpace of(long value); static @Nonnull LongSpace of(Range<Long> range); static @Nonnull LongSpace of(RangeSet<Long> rangeSet); static @Nonnull LongSpace parse(String s); static @Nonnull LongSpace unionOf(Iterable<Range<Long>> ranges); @SafeVarargs @SuppressWarnings("varargs") static @Nonnull LongSpace unionOf(Range<Long>... ranges); @Override @Nonnull Set<Long> enumerate(); @Nonnull LongStream longStream(); }
LongSpace extends NumberSpace<Long, LongSpace, LongSpace.Builder> { public static @Nonnull Builder builder() { return new Builder(); } protected  LongSpace(RangeSet<Long> rangeset); static @Nonnull Builder builder(); static @Nonnull LongSpace of(long value); static @Nonnull LongSpace of(Range<Long> range); static @Nonnull LongSpace of(RangeSet<Long> rangeSet); static @Nonnull LongSpace parse(String s); static @Nonnull LongSpace unionOf(Iterable<Range<Long>> ranges); @SafeVarargs @SuppressWarnings("varargs") static @Nonnull LongSpace unionOf(Range<Long>... ranges); @Override @Nonnull Set<Long> enumerate(); @Nonnull LongStream longStream(); static final LongSpace EMPTY; }