private static String padString(String s,Align alignment,int minLength){
  if (alignment == Align.Left) {
    return padRight(s,minLength);
  }
 else   if (alignment == Align.Right) {
    return padLeft(s,minLength);
  }
 else {
    throw new IndexOutOfBoundsException("Invalid alignment");
  }
}

private static String padString ( String s , Align alignment , int minLength ) { if ( alignment == Align . Left ) { return padRight ( s , minLength ) ; } else if ( alignment == Align . Right ) { return padLeft ( s , minLength ) ; } else { throw new IndexOutOfBoundsException ( "Invalid alignment" ) ; } }
adds padding to the a string with a repeating character if the string ' s length is less than the minimum length .
