public int getClassIdFromFileContents(String input) {
    //convert from decimal back to fixed size hex form
    //e.g 4325381 -> 00420005
    String classIdStr = String.format("%08x", Integer.parseInt(input));

    LOG.debug("ClassId hex string : {}", classIdStr);

    //extract and return 4 digits
    //e.g 00420005 -> 0005
    return Integer.parseInt(classIdStr.substring(4));
  }
@Test
  public void testClassIdFileContentParsing() {
    conf.setBoolean(YarnConfiguration.NM_RECOVERY_ENABLED, false);

    TrafficController trafficController = new TrafficController(conf,
        privilegedOperationExecutorMock);

    //Verify that classid file contents are parsed correctly
    //This call strips the QDISC prefix and returns the classid asociated with
    //the container
    int parsedClassId = trafficController.getClassIdFromFileContents
        (TEST_CLASS_ID_DECIMAL_STR);

    Assert.assertEquals(TEST_CLASS_ID, parsedClassId);
  }