// --------------------------------------------------------------------------------------------
@Test
public void testShipStrategyCombinationsPlain() {
Costs hashBothSmall = new Costs();
Costs hashSmallAndLarge = new Costs();
Costs hashBothLarge = new Costs();
Costs hashSmallBcLarge10 = new Costs();
Costs hashLargeBcSmall10 = new Costs();
Costs hashSmallBcLarge1000 = new Costs();
Costs hashLargeBcSmall1000 = new Costs();
Costs forwardSmallBcLarge10 = new Costs();
Costs forwardLargeBcSmall10 = new Costs();
Costs forwardSmallBcLarge1000 = new Costs();
Costs forwardLargeBcSmall1000 = new Costs();
costEstimator.addHashPartitioningCost(MEDIUM_ESTIMATES, hashBothSmall);
costEstimator.addHashPartitioningCost(MEDIUM_ESTIMATES, hashBothSmall);
costEstimator.addHashPartitioningCost(MEDIUM_ESTIMATES, hashSmallAndLarge);
costEstimator.addHashPartitioningCost(BIG_ESTIMATES, hashSmallAndLarge);
costEstimator.addHashPartitioningCost(BIG_ESTIMATES, hashBothLarge);
costEstimator.addHashPartitioningCost(BIG_ESTIMATES, hashBothLarge);
costEstimator.addHashPartitioningCost(MEDIUM_ESTIMATES, hashSmallBcLarge10);
costEstimator.addBroadcastCost(BIG_ESTIMATES, 10, hashSmallBcLarge10);
costEstimator.addHashPartitioningCost(BIG_ESTIMATES, hashLargeBcSmall10);
costEstimator.addBroadcastCost(MEDIUM_ESTIMATES, 10, hashLargeBcSmall10);
costEstimator.addHashPartitioningCost(MEDIUM_ESTIMATES, hashSmallBcLarge1000);
costEstimator.addBroadcastCost(BIG_ESTIMATES, 1000, hashSmallBcLarge1000);
costEstimator.addHashPartitioningCost(BIG_ESTIMATES, hashLargeBcSmall1000);
costEstimator.addBroadcastCost(MEDIUM_ESTIMATES, 1000, hashLargeBcSmall1000);
costEstimator.addBroadcastCost(BIG_ESTIMATES, 10, forwardSmallBcLarge10);
costEstimator.addBroadcastCost(MEDIUM_ESTIMATES, 10, forwardLargeBcSmall10);
costEstimator.addBroadcastCost(BIG_ESTIMATES, 1000, forwardSmallBcLarge1000);
costEstimator.addBroadcastCost(MEDIUM_ESTIMATES, 1000, forwardLargeBcSmall1000);
// hash cost is roughly monotonous
assertTrue(hashBothSmall.compareTo(hashSmallAndLarge) < 0);
assertTrue(hashSmallAndLarge.compareTo(hashBothLarge) < 0);
// broadcast the smaller is better
assertTrue(hashLargeBcSmall10.compareTo(hashSmallBcLarge10) < 0);
assertTrue(forwardLargeBcSmall10.compareTo(forwardSmallBcLarge10) < 0);
assertTrue(hashLargeBcSmall1000.compareTo(hashSmallBcLarge1000) < 0);
assertTrue(forwardLargeBcSmall1000.compareTo(forwardSmallBcLarge1000) < 0);
// broadcasting small and forwarding large is better than partition both, given size difference
assertTrue(forwardLargeBcSmall10.compareTo(hashSmallAndLarge) < 0);
// broadcasting too far is expensive again
assertTrue(forwardLargeBcSmall1000.compareTo(hashSmallAndLarge) > 0);
// assert weight is respected
assertTrue(hashSmallBcLarge10.compareTo(hashSmallBcLarge1000) < 0);
assertTrue(hashLargeBcSmall10.compareTo(hashLargeBcSmall1000) < 0);
assertTrue(forwardSmallBcLarge10.compareTo(forwardSmallBcLarge1000) < 0);
assertTrue(forwardLargeBcSmall10.compareTo(forwardLargeBcSmall1000) < 0);
// forward versus hash
assertTrue(forwardSmallBcLarge10.compareTo(hashSmallBcLarge10) < 0);
assertTrue(forwardSmallBcLarge1000.compareTo(hashSmallBcLarge1000) < 0);
assertTrue(forwardLargeBcSmall10.compareTo(hashLargeBcSmall10) < 0);
assertTrue(forwardLargeBcSmall1000.compareTo(hashLargeBcSmall1000) < 0);
}