@Test public void testDifference() { LongSpace s1 = LongSpace.builder().including(Range.closed(1L, 10L)).build(); LongSpace s2 = LongSpace.builder().including(Range.closed(5L, 15L)).build(); LongSpace expected = LongSpace.builder().including(Range.closed(1L, 4L)).build(); LongSpace expectedFlipped = LongSpace.builder().including(Range.closed(11L, 15L)).build(); assertThat(s1.difference(s2), equalTo(expected)); assertThat(s2.difference(s1), equalTo(expectedFlipped)); LongSpace unconnected = LongSpace.builder().including(Range.closed(100L, 200L)).build(); assertThat(s1.difference(unconnected), equalTo(s1)); assertThat(unconnected.difference(s1), equalTo(unconnected)); assertThat(s1.difference(s1), 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; }