### Question:
BootstrapDatasetUnion { public static DataSet<TaggedBootstrapData> apply(List<BootstrapDataset<?>> bootstrapDatasets) { Objects.requireNonNull(bootstrapDatasets); Preconditions.checkArgument(bootstrapDatasets.size() > 0); final List<DataSet<TaggedBootstrapData>> unionBootstrapDataset = new ArrayList<>(bootstrapDatasets.size()); final TypeInformation<TaggedBootstrapData> unionTypeInfo = createUnionTypeInfo(bootstrapDatasets); int unionIndex = 0; for (BootstrapDataset<?> bootstrapDataset : bootstrapDatasets) { unionBootstrapDataset.add(toTaggedFlinkDataSet(bootstrapDataset, unionIndex, unionTypeInfo)); unionIndex++; } return unionTaggedBootstrapDataSets(unionBootstrapDataset); }  static DataSet<TaggedBootstrapData> apply(List<BootstrapDataset<?>> bootstrapDatasets);  }### Answer:
@Test public void correctTypeInformation() { final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment(); final List<BootstrapDataset<?>> bootstrapDatasets = new ArrayList<>(2); bootstrapDatasets.add( createBootstrapDataset(env, Collections.singletonList(1), TestRouter::noOp)); bootstrapDatasets.add( createBootstrapDataset(env, Collections.singletonList(true), TestRouter::noOp)); final DataSet<TaggedBootstrapData> test = BootstrapDatasetUnion.apply(bootstrapDatasets); assertThat( test.getType(), is(unionTypeInfoOf(BasicTypeInfo.INT_TYPE_INFO, BasicTypeInfo.BOOLEAN_TYPE_INFO))); }
@Test public void correctUnion() throws Exception { final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment(); final List<BootstrapDataset<?>> bootstrapDatasets = new ArrayList<>(2); bootstrapDatasets.add( createBootstrapDataset( env, Collections.singletonList(911108), () -> new TestRouter<>(addressOf("ns", "name", "id-0"), 2))); bootstrapDatasets.add( createBootstrapDataset( env, Arrays.asList(true, false), () -> new TestRouter<>(addressOf("ns", "name-2", "id-99"), 1))); final List<TaggedBootstrapData> test = BootstrapDatasetUnion.apply(bootstrapDatasets).collect(); assertThat( test, Matchers.containsInAnyOrder( taggedBootstrapData(addressOf("ns", "name", "id-0"), 911108, 0), taggedBootstrapData(addressOf("ns", "name", "id-0"), 911108, 0), taggedBootstrapData(addressOf("ns", "name-2", "id-99"), true, 1), taggedBootstrapData(addressOf("ns", "name-2", "id-99"), false, 1))); }