public static boolean isBoolean(String str){
  return str.equals("true") || str.equals("false") || str.equals("yes")|| str.equals("no");
}

public static boolean isBoolean ( String str ) { return str . equals ( "true" ) || str . equals ( "false" ) || str . equals ( "yes" ) || str . equals ( "no" ) ; }
check the given string is a boolean literal
