when(plan1.getOverallResults()).thenReturn(plan1ResultNode);
when(plan1.getWinningAlternative()).thenReturn("alternative3");
plans.add(plan1);
// Measures
Measure m1 = mock(Measure.class);
when(m1.getUri()).thenReturn("http://measure1");
Measure m2 = mock(Measure.class);
when(m2.getUri()).thenReturn("http://measure2");
Measure m3 = mock(Measure.class);
when(m3.getUri()).thenReturn("http://measure3");
// Leaves
// Leaf1
VPlanLeaf leaf1 = mock(VPlanLeaf.class);
when(leaf1.isMapped()).thenReturn(true);
when(leaf1.getPlanId()).thenReturn(1);
when(leaf1.getMeasure()).thenReturn(m1);
when(leaf1.hasKOPotential()).thenReturn(false);
when(leaf1.getPotentialMinimum()).thenReturn(1d);
when(leaf1.getPotentialMaximum()).thenReturn(4d);
when(leaf1.getTotalWeight()).thenReturn(0.1d);
Map<String, Double> leaf1Results = new HashMap<String, Double>();
leaf1Results.put("alternative1", 1d);
leaf1Results.put("alternative2", 2d);
leaf1Results.put("alternative3", 3d);
when(leaf1.getAlternativeResultsAsMap()).thenReturn(leaf1Results);
// Leaf2
VPlanLeaf leaf2 = mock(VPlanLeaf.class);
when(leaf2.isMapped()).thenReturn(true);
when(leaf2.getPlanId()).thenReturn(1);
when(leaf2.getMeasure()).thenReturn(m2);
when(leaf2.hasKOPotential()).thenReturn(false);
when(leaf2.getPotentialMinimum()).thenReturn(1d);
when(leaf2.getPotentialMaximum()).thenReturn(4d);
when(leaf2.getTotalWeight()).thenReturn(0.1d);
Map<String, Double> leaf2Results = new HashMap<String, Double>();
leaf2Results.put("alternative1", 1d);
leaf2Results.put("alternative2", 2d);
leaf2Results.put("alternative3", 3d);
when(leaf2.getAlternativeResultsAsMap()).thenReturn(leaf2Results);
// Leaf3
VPlanLeaf leaf3 = mock(VPlanLeaf.class);
when(leaf3.isMapped()).thenReturn(true);
when(leaf3.getPlanId()).thenReturn(1);
when(leaf3.getMeasure()).thenReturn(m3);
when(leaf3.hasKOPotential()).thenReturn(false);
when(leaf3.getPotentialMinimum()).thenReturn(1d);
when(leaf3.getPotentialMaximum()).thenReturn(4d);
when(leaf3.getTotalWeight()).thenReturn(0.1d);
Map<String, Double> leaf3Results = new HashMap<String, Double>();
leaf3Results.put("alternative1", 1d);
leaf3Results.put("alternative2", 2d);
leaf3Results.put("alternative3", 3d);
when(leaf3.getAlternativeResultsAsMap()).thenReturn(leaf3Results);
List<VPlanLeaf> leaves = new ArrayList<VPlanLeaf>();
leaves.add(leaf1);
leaves.add(leaf2);
leaves.add(leaf3);
DominatedSets c = new RankChangingDominatedSets(plans, leaves);
List<List<String>> rangeChangingSets = c.getDominatedSets(Aggregation.ALL);
// Assert
assertEquals(rangeChangingSets.size(), 1);
List<String> set1 = rangeChangingSets.get(0);
assertEquals(set1.size(), 3);
assertTrue(set1.contains(m1.getUri()));
assertTrue(set1.contains(m2.getUri()));
assertTrue(set1.contains(m3.getUri()));
}