code: public static boolean isBoolean(String number) {
          boolean result = false;
          if (number != null && (number.equalsIgnoreCase("true") || number.equalsIgnoreCase("false"))) {
              result = true;
          }
          return result;
      }
docs: Checks if a string is a valid boolean
  
  @param number The string to check
  @return True if the string is equals to either true or false . Else false.