Created
August 3, 2021 06:30
-
-
Save izquiratops/64123088274bbe6afb8518f3a3c26aa0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.google.common.collect.ImmutableRangeSet; | |
import com.google.common.collect.Range; | |
public class TerstingLibs { | |
private static final ImmutableRangeSet<Integer> RANGE_SET_ONE = | |
ImmutableRangeSet.<Integer>builder() | |
.add(Range.closed(2, 4)) | |
.add(Range.open(6, 7)) | |
.add(Range.closedOpen(8, 10)) | |
.add(Range.openClosed(15, 17)) | |
.build(); | |
private static final ImmutableRangeSet<Integer> RANGE_SET_TWO = | |
ImmutableRangeSet.<Integer>builder() | |
.add(Range.openClosed(0, 3)) | |
.add(Range.closed(5, 8)) | |
.add(Range.closedOpen(12, 15)) | |
.add(Range.open(19, 20)) | |
.build(); | |
public static void main (String[] args) { | |
ImmutableRangeSet result = RANGE_SET_ONE.difference(RANGE_SET_TWO); | |
System.out.println("Done!"); | |
} | |
} |
Author
izquiratops
commented
Aug 3, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment