boolean ( PsiExpression lhs, PsiExpression rhs, boolean flipped, IElementType tokenType) { final PsiMethodCallExpression callExpression = (PsiMethodCallExpression)lhs; if (!isIndexOfCall(callExpression)) { return false; } final Object object = ExpressionUtils.computeConstantExpression(rhs); if (!(object instanceof Integer integer)) { return false; } final int constant = integer.intValue(); if (flipped) { if (constant == -1 && (JavaTokenType.NE.equals(tokenType) || JavaTokenType.LT.equals(tokenType) || JavaTokenType.EQEQ.equals(tokenType) || JavaTokenType.GE.equals(tokenType))) { return true; } else if (constant == 0 && (JavaTokenType.LE.equals(tokenType) || JavaTokenType.GT.equals(tokenType))) { return true; } } else { if (constant == -1 && (JavaTokenType.NE.equals(tokenType) || JavaTokenType.GT.equals(tokenType) || JavaTokenType.EQEQ.equals(tokenType) || JavaTokenType.LE.equals(tokenType))) { return true; } else if (constant == 0 && (JavaTokenType.GE.equals(tokenType) || JavaTokenType.LT.equals(tokenType))) { return true; } } return false; }