public static String[][] normalizeArrays( int normalizeToLength, String[]... arraysToNormalize ) {
    if ( arraysToNormalize == null ) {
      return null;
    }
    int arraysToProcess = arraysToNormalize.length;
    String[][] rtn = new String[ arraysToProcess ][];
    for ( int i = 0; i < arraysToNormalize.length; i++ ) {
      String[] nextArray = arraysToNormalize[ i ];
      if ( nextArray != null ) {
        if ( nextArray.length < normalizeToLength ) {
          String[] newArray = new String[ normalizeToLength ];
          System.arraycopy( nextArray, 0, newArray, 0, nextArray.length );
          rtn[ i ] = newArray;
        } else {
          rtn[ i ] = nextArray;
        }
      } else {
        rtn[ i ] = new String[ normalizeToLength ];
      }
    }
    return rtn;
  }
@Test
  public void testNormalizeArraysMethods() {
    String[] s1 = new String[] { "one" };
    String[] s2 = new String[] { "one", "two" };
    String[] s3 = new String[] { "one", "two", "three" };
    long[] l1 = new long[] { 1 };
    long[] l2 = new long[] { 1, 2 };
    long[] l3 = new long[] { 1, 2, 3 };
    short[] sh1 = new short[] { 1 };
    short[] sh2 = new short[] { 1, 2 };
    short[] sh3 = new short[] { 1, 2, 3 };
    boolean[] b1 = new boolean[] { true };
    boolean[] b2 = new boolean[] { true, false };
    boolean[] b3 = new boolean[] { true, false, true };
    int[] i1 = new int[] { 1 };
    int[] i2 = new int[] { 1, 2 };
    int[] i3 = new int[] { 1, 3 };

    String[][] newS = Utils.normalizeArrays( 3, s1, s2 );
    assertEquals( 2, newS.length );
    assertEquals( 3, newS[ 0 ].length );
    assertEquals( 3, newS[ 1 ].length );
    newS = Utils.normalizeArrays( 3, s1, null );
    assertEquals( 2, newS.length );
    assertEquals( 3, newS[ 0 ].length );
    assertEquals( 3, newS[ 1 ].length );
    newS = Utils.normalizeArrays( 2, s2 );
    assertEquals( 1, newS.length );
    assertEquals( 2, newS[ 0 ].length );
    assertArrayEquals( newS[ 0 ], s2 );
    assertTrue( newS[ 0 ] == s2 ); // If arrays are equal sized, it should return original object

    long[][] newL = Utils.normalizeArrays( 3, l1, l2 );
    assertEquals( 2, newL.length );
    assertEquals( 3, newL[ 0 ].length );
    assertEquals( 3, newL[ 1 ].length );
    newL = Utils.normalizeArrays( 3, l1, null );
    assertEquals( 2, newL.length );
    assertEquals( 3, newL[ 0 ].length );
    assertEquals( 3, newL[ 1 ].length );
    newL = Utils.normalizeArrays( 2, l2 );
    assertEquals( 1, newL.length );
    assertEquals( 2, newL[ 0 ].length );
    assertArrayEquals( newL[ 0 ], l2 );
    assertTrue( newL[ 0 ] == l2 ); // If arrays are equal sized, it should return original object

    short[][] newSh = Utils.normalizeArrays( 3, sh1, sh2 );
    assertEquals( 2, newSh.length );
    assertEquals( 3, newSh[ 0 ].length );
    assertEquals( 3, newSh[ 1 ].length );
    newSh = Utils.normalizeArrays( 3, sh1, null );
    assertEquals( 2, newSh.length );
    assertEquals( 3, newSh[ 0 ].length );
    assertEquals( 3, newSh[ 1 ].length );
    newSh = Utils.normalizeArrays( 2, sh2 );
    assertEquals( 1, newSh.length );
    assertEquals( 2, newSh[ 0 ].length );
    assertArrayEquals( newSh[ 0 ], sh2 );
    assertTrue( newSh[ 0 ] == sh2 ); // If arrays are equal sized, it should return original object

    boolean[][] newB = Utils.normalizeArrays( 3, b1, b2 );
    assertEquals( 2, newB.length );
    assertEquals( 3, newB[ 0 ].length );
    assertEquals( 3, newB[ 1 ].length );
    newB = Utils.normalizeArrays( 3, b1, null );
    assertEquals( 2, newB.length );
    assertEquals( 3, newB[ 0 ].length );
    assertEquals( 3, newB[ 1 ].length );
    newB = Utils.normalizeArrays( 2, b2 );
    assertEquals( 1, newB.length );
    assertEquals( 2, newB[ 0 ].length );
    assertTrue( newB[ 0 ] == b2 ); // If arrays are equal sized, it should return original object

    int[][] newI = Utils.normalizeArrays( 3, i1, i2 );
    assertEquals( 2, newI.length );
    assertEquals( 3, newI[ 0 ].length );
    assertEquals( 3, newI[ 1 ].length );
    newI = Utils.normalizeArrays( 3, i1, null );
    assertEquals( 2, newI.length );
    assertEquals( 3, newI[ 0 ].length );
    assertEquals( 3, newI[ 1 ].length );
    newI = Utils.normalizeArrays( 2, i2 );
    assertEquals( 1, newI.length );
    assertEquals( 2, newI[ 0 ].length );
    assertArrayEquals( newI[ 0 ], i2 );
    assertTrue( newI[ 0 ] == i2 ); // If arrays are equal sized, it should return original object

  }