Created
July 25, 2017 08:21
-
-
Save trickyBytes/81258877772ccb70bdbd3493174290f3 to your computer and use it in GitHub Desktop.
Using Guava collection builders and Sets to create Cartesian product of some packages
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
List<List<IComponentsAction>> alternatives ... | |
Set<List<IComponentsAction>> product ... | |
final Builder<Set<IComponentsAction>> builder = ImmutableList.<Set<IComponentsAction>>builder(); | |
alternatives.forEach(pkg -> { | |
builder.add(ImmutableSet.copyOf(pkg)); | |
}); | |
product = Sets.cartesianProduct(builder.build()); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment