@Test
public void testSquashCGroupOperationsWithValidOperations() {

  List<PrivilegedOperation> ops = new ArrayList<>();
  //Test squashing, including 'none'
  ops.clear();
  ops.add(opTasks1);
  //this is expected to be ignored
  ops.add(opTasksNone);
  ops.add(opTasks2);
  ops.add(opTasks3);
  try {
    PrivilegedOperation op = PrivilegedOperationExecutor
        .squashCGroupOperations(ops);
    String expected = new StringBuffer
        (PrivilegedOperation.CGROUP_ARG_PREFIX)
        .append(cGroupTasks1).append(PrivilegedOperation
            .LINUX_FILE_PATH_SEPARATOR)
        .append(cGroupTasks2).append(PrivilegedOperation
            .LINUX_FILE_PATH_SEPARATOR)
        .append(cGroupTasks3).toString();
    //We expect axactly one argument
    Assert.assertEquals(1, op.getArguments().size());
    //Squashed list of tasks files
    Assert.assertEquals(expected, op.getArguments().get(0));
  } catch (PrivilegedOperationException e) {
    LOG.info("Caught unexpected exception : " + e);
    Assert.fail("Caught unexpected exception: " + e);
  }
}