code: public static boolean toBoolean(final String str, final String trueString, final String falseString) {
          if (str == trueString) {
              return true;
          } else if (str == falseString) {
              return false;
          } else if (str != null) {
              if (str.equals(trueString)) {
                  return true;
              } else if (str.equals(falseString)) {
                  return false;
              }
          }
          // no match
          throw new IllegalArgumentException("The String did not match either specified value");
      }
docs: <p>Converts a String to a Boolean throwing an exception if no match found.</p>
  
  <pre>
  BooleanUtils.toBoolean("true", "true", "false")  = true
  BooleanUtils.toBoolean("false", "true", "false") = false
  </pre>
  
  @param str  the String to check
  @param trueString  the String to match for {@code true} (case sensitive), may be {@code null}
  @param falseString  the String to match for {@code false} (case sensitive), may be {@code null}
  @return the boolean value of the string
  @throws IllegalArgumentException if the String doesn't match