@Test(expectedExceptions = RuntimeException.class)
public void testValidateTonyConfTooManyTotalInstances() {

  Configuration conf = new Configuration();
  conf.setInt(TonyConfigurationKeys.MAX_TOTAL_INSTANCES, 3);
  conf.setInt("tony.foo.instances", 2);
  conf.setInt("tony.bar.instances", 2);
  TonyClient.validateTonyConf(conf);
}