@Test
public void testInvalidBuilder() {

  conf.setBoolean(YarnConfiguration.NM_RECOVERY_ENABLED, false);
  TrafficController trafficController = new TrafficController(conf,
      privilegedOperationExecutorMock);
  try {
    trafficController
        .bootstrap(DEVICE, ROOT_BANDWIDTH_MBIT, YARN_BANDWIDTH_MBIT);
    try {
      //Invalid op type for TC batch builder
      TrafficController.BatchBuilder invalidBuilder = trafficController.
          new BatchBuilder(
          PrivilegedOperation.OperationType.ADD_PID_TO_CGROUP);
      Assert.fail("Invalid builder check failed!");
    } catch (ResourceHandlerException e) {
      //expected
    }
  } catch (ResourceHandlerException e) {
    LOG.error("Unexpected exception: " + e);
    Assert.fail("Caught unexpected exception: "
        + e.getClass().getSimpleName());
  }
}