Make JDK 1.4 compatible again.
Fix spelling.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/cli/branches/cli-1.x@751120 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/src/java/org/apache/commons/cli/HelpFormatter.java b/src/java/org/apache/commons/cli/HelpFormatter.java
index a46b0ec..c828524 100644
--- a/src/java/org/apache/commons/cli/HelpFormatter.java
+++ b/src/java/org/apache/commons/cli/HelpFormatter.java
@@ -48,7 +48,7 @@
      */
     public static final int DEFAULT_DESC_PAD = 3;
 
-    /** the string to display at the begining of the usage statement */
+    /** the string to display at the beginning of the usage statement */
     public static final String DEFAULT_SYNTAX_PREFIX = "usage: ";
 
     /** default prefix for shortOpts */
@@ -388,7 +388,7 @@
      *
      * @param width the number of characters to be displayed on each line
      * @param cmdLineSyntax the syntax for this application
-     * @param header the banner to display at the begining of the help
+     * @param header the banner to display at the beginning of the help
      * @param options the Options instance
      * @param footer the banner to display at the end of the help
      */
diff --git a/src/test/org/apache/commons/cli/HelpFormatterTest.java b/src/test/org/apache/commons/cli/HelpFormatterTest.java
index 28550ab..10ecab3 100644
--- a/src/test/org/apache/commons/cli/HelpFormatterTest.java
+++ b/src/test/org/apache/commons/cli/HelpFormatterTest.java
@@ -40,7 +40,7 @@
         HelpFormatter hf = new HelpFormatter();
 
         String text = "This is a test.";
-        //text width should be max 8; the wrap postition is 7
+        //text width should be max 8; the wrap position is 7
         assertEquals("wrap position", 7, hf.findWrapPos(text, 8, 0));
         //starting from 8 must give -1 - the wrap pos is after end
         assertEquals("wrap position 2", -1, hf.findWrapPos(text, 8, 8));
diff --git a/src/test/org/apache/commons/cli/OptionGroupTest.java b/src/test/org/apache/commons/cli/OptionGroupTest.java
index f68733f..eea69ee 100644
--- a/src/test/org/apache/commons/cli/OptionGroupTest.java
+++ b/src/test/org/apache/commons/cli/OptionGroupTest.java
@@ -201,17 +201,17 @@
         group1.addOption(new Option(null, "foo", false, "Foo"));
         group1.addOption(new Option(null, "bar", false, "Bar"));
 
-        assertEquals("[--foo Foo, --bar Bar]".length(), group1.toString().length());
-        assertTrue(group1.toString().contains("--foo Foo"));
-        assertTrue(group1.toString().contains("--bar Bar"));
+        if (!"[--bar Bar, --foo Foo]".equals(group1.toString())) {
+            assertEquals("[--foo Foo, --bar Bar]", group1.toString());
+        }
 
         OptionGroup group2 = new OptionGroup();
         group2.addOption(new Option("f", "foo", false, "Foo"));
         group2.addOption(new Option("b", "bar", false, "Bar"));
 
-        assertEquals("[-f Foo, -b Bar]".length(), group2.toString().length());
-        assertTrue(group2.toString().contains("-f Foo"));
-        assertTrue(group2.toString().contains("-b Bar"));
+        if (!"[-b Bar, -f Foo]".equals(group2.toString())) {
+            assertEquals("[-f Foo, -b Bar]", group2.toString());
+        }
     }
 
     public void testGetNames()