code: public static boolean isEqual(String string0, String string1, boolean caseSensitive) {
          if (string0 == null && string1 == null) {
              return true;
          }
          if (string0 == null && string1 != null) {
              return false;
          }
          if (string0 != null && string1 == null) {
              return false;
          }
          if (caseSensitive) {
              return string0.equals(string1);
          } else {
              return string0.equalsIgnoreCase(string1);
          }
      }
docs: Checks if both strings are equal to each other.  Safely handles the case
  where either string may be null.  The strings are evaluated as equal if
  they are both null or if they actually equal each other.  One string
  that is null while the other one isn't (even if its an empty string) will
  be considered as NOT equal.  Case sensitive comparisons are optional.
  @param string0 The string to compare
  @param string1 The other string to compare with
  @param caseSensitive If true a case sensitive comparison will be made,
  otherwise equalsIgnoreCase will be used.
  @return True if the strings are both null or equal to each other, otherwise
  false.