@Test public void testMultiEnvironmentMetadataMerge() { ArtifactKey key = new DefaultArtifactKey("type", "id", "version"); File location = new File("location"); DefaultTargetPlatform tpA = new DefaultTargetPlatform(); tpA.addArtifactFile(key, location, asSet("a")); DefaultTargetPlatform tpB = new DefaultTargetPlatform(); tpB.addArtifactFile(key, location, asSet("a", "b")); MultiEnvironmentTargetPlatform tp = new MultiEnvironmentTargetPlatform(); tp.addPlatform(new TargetEnvironment("a", "a", "a", "a"), tpA); tp.addPlatform(new TargetEnvironment("b", "b", "b", "b"), tpB); List<ArtifactDescriptor> artifacts = tp.getArtifacts(); Assert.assertEquals(1, artifacts.size()); Set<Object> units = artifacts.get(0).getInstallableUnits(); Assert.assertEquals(2, units.size()); Assert.assertTrue(units.contains("a")); Assert.assertTrue(units.contains("b")); }