public static boolean isTerminal(String s){
  for (int i=0; i < s.length(); i++) {
    if (!Character.isLowerCase(s.charAt(i))) {
      return false;
    }
  }
  return true;
}

public static boolean isTerminal ( String s ) { for ( int i = 0 ; i < s . length ( ) ; i ++ ) { if ( ! Character . isLowerCase ( s . charAt ( i ) ) ) { return false ; } } return true ; }
check if we have a terminal , as they are lowercase strings
