@Test(timeout = 10000)
public void testFitsIn() {

  if (resourceCalculator instanceof DefaultResourceCalculator) {
    Assert.assertTrue(resourceCalculator.fitsIn(
        Resource.newInstance(1, 2), Resource.newInstance(2, 1)));
    Assert.assertTrue(resourceCalculator.fitsIn(
        Resource.newInstance(1, 2), Resource.newInstance(2, 2)));
    Assert.assertTrue(resourceCalculator.fitsIn(
        Resource.newInstance(1, 2), Resource.newInstance(1, 2)));
    Assert.assertTrue(resourceCalculator.fitsIn(
        Resource.newInstance(1, 2), Resource.newInstance(1, 1)));
    Assert.assertFalse(resourceCalculator.fitsIn(
        Resource.newInstance(2, 1), Resource.newInstance(1, 2)));
  } else if (resourceCalculator instanceof DominantResourceCalculator) {
    Assert.assertFalse(resourceCalculator.fitsIn(
        Resource.newInstance(1, 2), Resource.newInstance(2, 1)));
    Assert.assertTrue(resourceCalculator.fitsIn(
        Resource.newInstance(1, 2), Resource.newInstance(2, 2)));
    Assert.assertTrue(resourceCalculator.fitsIn(
        Resource.newInstance(1, 2), Resource.newInstance(1, 2)));
    Assert.assertFalse(resourceCalculator.fitsIn(
        Resource.newInstance(1, 2), Resource.newInstance(1, 1)));
    Assert.assertFalse(resourceCalculator.fitsIn(
        Resource.newInstance(2, 1), Resource.newInstance(1, 2)));
  }
}