@Test
  public void testFailureOnUnrecognizedOption() throws Exception {
    String[] args = new String[] { "--required=foo", "-asdfs" };
    int returnValue = tool.run(args);
    assertEquals(EXIT_FAILURE, returnValue);
  }
Simple tool to test options parsing. 3 options: required, optional, and boolean 2 deprecated
options to test backward compatibility: -opt (old version of --optional) and -bool (old version
of --boolean).
hbase-common/src/test/java/org/apache/hadoop/hbase/util/AbstractHBaseToolTest.java