@Test
public void testRemoveFromClusterNodeLabels() throws Exception {

  // Successfully remove labels
  dummyNodeLabelsManager.addToCluserNodeLabelsWithDefaultExclusivity(ImmutableSet.of("x", "y"));
  String[] args =
      { "-removeFromClusterNodeLabels", "x,,y",
          "-directlyAccessNodeLabelStore" };
  assertEquals(0, rmAdminCLI.run(args));
  assertTrue(dummyNodeLabelsManager.getClusterNodeLabelNames().isEmpty());
  
  // no labels, should fail
  args = new String[] { "-removeFromClusterNodeLabels" };
  assertTrue(0 != rmAdminCLI.run(args));
  
  // no labels, should fail
  args =
      new String[] { "-removeFromClusterNodeLabels",
          "-directlyAccessNodeLabelStore" };
  assertTrue(0 != rmAdminCLI.run(args));
  // no labels, should fail at client validation
  args = new String[] { "-removeFromClusterNodeLabels", " " };
  assertTrue(0 != rmAdminCLI.run(args));
  // no labels, should fail at client validation
  args = new String[] { "-removeFromClusterNodeLabels", ", " };
  assertTrue(0 != rmAdminCLI.run(args));
}