@Test
public void testGetOverallLimits() {

  int expectedQuota = 1000 * 1000;
  CgroupsLCEResourcesHandler handler = new CgroupsLCEResourcesHandler();
  int[] ret = handler.getOverallLimits(2);
  Assert.assertEquals(expectedQuota / 2, ret[0]);
  Assert.assertEquals(expectedQuota, ret[1]);
  ret = handler.getOverallLimits(2000);
  Assert.assertEquals(expectedQuota, ret[0]);
  Assert.assertEquals(-1, ret[1]);
  int[] params = {0, -1};
  for (int cores : params) {
    try {
      handler.getOverallLimits(cores);
      Assert.fail("Function call should throw error.");
    } catch (IllegalArgumentException ie) {
      // expected
    }
  }
  // test minimums
  ret = handler.getOverallLimits(1000 * 1000);
  Assert.assertEquals(1000 * 1000, ret[0]);
  Assert.assertEquals(-1, ret[1]);
}