public static boolean checkForOr(byte[] filterStringAsByteArray, int indexOfOr)
    throws CharacterCodingException, ArrayIndexOutOfBoundsException {

    try {
      if (
        filterStringAsByteArray[indexOfOr] == ParseConstants.O
          && filterStringAsByteArray[indexOfOr + 1] == ParseConstants.R
          && (filterStringAsByteArray[indexOfOr - 1] == ParseConstants.WHITESPACE
            || filterStringAsByteArray[indexOfOr - 1] == ParseConstants.RPAREN)
          && (filterStringAsByteArray[indexOfOr + 2] == ParseConstants.WHITESPACE
            || filterStringAsByteArray[indexOfOr + 2] == ParseConstants.LPAREN)
      ) {
        return true;
      } else {
        return false;
      }
    } catch (ArrayIndexOutOfBoundsException e) {
      return false;
    }
  }
Checks if the current index of filter string we are on is the beginning of the keyword 'OR'
<p>
@param filterStringAsByteArray filter string given by the user
@param indexOfOr               index at which an 'O' was read
@return true if the keyword 'OR' is at the current index
hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ParseFilter.java