@Test public void product() throws Exception { final List<Map<Any2<Integer, String>, Any3<Boolean, Integer, String>>> resolution = nrs.resolve().map(NamedResolverMap::getRawMap).collect(Collectors.toList()); assertThat(resolution, containsInAnyOrder( new HashMap<Any2<Integer, String>, Any3<Boolean, Integer, String>>() { { put(Any2.left(0), Any3.create3("a")); put(Any2.left(1), Any3.create3("x")); } }, new HashMap<Any2<Integer, String>, Any3<Boolean, Integer, String>>() { { put(Any2.left(0), Any3.create3("a")); put(Any2.left(1), Any3.create3("y")); } }, new HashMap<Any2<Integer, String>, Any3<Boolean, Integer, String>>() { { put(Any2.left(0), Any3.create3("b")); put(Any2.left(1), Any3.create3("x")); } }, new HashMap<Any2<Integer, String>, Any3<Boolean, Integer, String>>() { { put(Any2.left(0), Any3.create3("b")); put(Any2.left(1), Any3.create3("y")); } } )); }
@Override public Stream<NamedResolverMap> resolve() throws Exception { final List<List<NamedResolverMap>> sets = new ArrayList<>(nameResolvers.size()); for (NameBoundResolver nr : nameResolvers) sets.add(nr.resolve().collect(Collectors.toList())); return cartesianProduct(sets); }
NameBoundResolverSet implements NameBoundResolver { @Override public Stream<NamedResolverMap> resolve() throws Exception { final List<List<NamedResolverMap>> sets = new ArrayList<>(nameResolvers.size()); for (NameBoundResolver nr : nameResolvers) sets.add(nr.resolve().collect(Collectors.toList())); return cartesianProduct(sets); } }
NameBoundResolverSet implements NameBoundResolver { @Override public Stream<NamedResolverMap> resolve() throws Exception { final List<List<NamedResolverMap>> sets = new ArrayList<>(nameResolvers.size()); for (NameBoundResolver nr : nameResolvers) sets.add(nr.resolve().collect(Collectors.toList())); return cartesianProduct(sets); } NameBoundResolverSet(@NonNull Collection<NameBoundResolver> nameResolvers);  NameBoundResolverSet(NameBoundResolver... nameResolvers); }
NameBoundResolverSet implements NameBoundResolver { @Override public Stream<NamedResolverMap> resolve() throws Exception { final List<List<NamedResolverMap>> sets = new ArrayList<>(nameResolvers.size()); for (NameBoundResolver nr : nameResolvers) sets.add(nr.resolve().collect(Collectors.toList())); return cartesianProduct(sets); } NameBoundResolverSet(@NonNull Collection<NameBoundResolver> nameResolvers);  NameBoundResolverSet(NameBoundResolver... nameResolvers); @Override Stream<NamedResolverMap> resolve(); @Override Stream<Any2<Integer, String>> getKeys(); @Override String configString(); @Override boolean isEmpty(); @Override void close(); }
NameBoundResolverSet implements NameBoundResolver { @Override public Stream<NamedResolverMap> resolve() throws Exception { final List<List<NamedResolverMap>> sets = new ArrayList<>(nameResolvers.size()); for (NameBoundResolver nr : nameResolvers) sets.add(nr.resolve().collect(Collectors.toList())); return cartesianProduct(sets); } NameBoundResolverSet(@NonNull Collection<NameBoundResolver> nameResolvers);  NameBoundResolverSet(NameBoundResolver... nameResolvers); @Override Stream<NamedResolverMap> resolve(); @Override Stream<Any2<Integer, String>> getKeys(); @Override String configString(); @Override boolean isEmpty(); @Override void close();  }