@Test
public void testNoUnsupportedHACommandsInHelp() throws Exception {

  ByteArrayOutputStream dataErr = new ByteArrayOutputStream();
  System.setErr(new PrintStream(dataErr));
  String[] args = {};
  assertEquals(-1, rmAdminCLIWithHAEnabled.run(args));
  String errOut = dataErr.toString();
  assertFalse(errOut.contains("-transitionToObserver"));
  dataErr.reset();
  String[] args1 = {"-transitionToObserver"};
  assertEquals(-1, rmAdminCLIWithHAEnabled.run(args1));
  errOut = dataErr.toString();
  assertTrue(errOut.contains("transitionToObserver: Unknown command"));
  dataErr.reset();
  args1[0] = "-failover";
  assertEquals(-1, rmAdminCLIWithHAEnabled.run(args1));
  errOut = dataErr.toString();
  assertTrue(errOut.contains("failover: Unknown command"));
  dataErr.reset();
  String[] args2 = {"-help", "-transitionToObserver"};
  assertEquals(0, rmAdminCLIWithHAEnabled.run(args2));
  errOut = dataErr.toString();
  assertFalse(errOut.contains("-transitionToObserver"));
  dataErr.reset();
  args2[1] = "-failover";
  assertEquals(0, rmAdminCLIWithHAEnabled.run(args2));
  errOut = dataErr.toString();
  assertFalse(errOut.contains("-failover"));
  dataErr.reset();
}