class IntervalExpressionUtil {

    private static final String SPLIT_OR = "\\|\\|";
    private static final String SPLIT_AND = ",";
    private static final String SPLIT_EQU_LEFT = "(";
    private static final String SPLIT_EQU_RIGHT = ")";
    private static final String SPLIT_EQ_LEFT = "[";
    private static final String SPLIT_EQ_RIGHT = "]";
    private static final String NEGATIVE = "-∞";
    private static final String POSITIVE = "+∞";

    /**
     * CHECK WHETHER THE VALUE IS IN AN INTERVAL RANGE
     * @param numberValue NumericalValue
     * @param expression INTERVAL EXPRESSION
     * @return true-yes false-no
     */
    public static boolean validNumberIntervalExpress(Double numberValue, String expression) {<FILL_FUNCTION_BODY>}
}

        if (expression == null || "".equals(expression)) {
            return true;
        }
        if (numberValue == null) {
            return false;
        }
        try {
            String[] expressions = expression.split(SPLIT_OR);
            for (String expr : expressions) {
                String[] values = expr.substring(1, expr.length() - 1).split(SPLIT_AND);
                if (values.length != 2) {
                    continue;
                }
                Double[] doubleValues = new Double[2];
                if (NEGATIVE.equals(values[0])) {
                    doubleValues[0] = Double.MIN_VALUE;
                } else {
                    doubleValues[0] = Double.parseDouble(values[0]);
                }
                if (POSITIVE.equals(values[1])) {
                    doubleValues[1] = Double.MAX_VALUE;
                } else {
                    doubleValues[1] = Double.parseDouble(values[1]);
                }
                String startBracket = expr.substring(0, 1);
                String endBracket = expr.substring(expr.length() - 1);
                if (SPLIT_EQU_LEFT.equals(startBracket)) {
                    if (SPLIT_EQU_RIGHT.equals(endBracket)) {
                        if (numberValue > doubleValues[0] && numberValue < doubleValues[1]) {
                            return true;
                        }
                    } else if (SPLIT_EQ_RIGHT.equals(endBracket)) {
                        if (numberValue > doubleValues[0] && numberValue <= doubleValues[1]) {
                            return true;
                        }
                    }
                } else if (SPLIT_EQ_LEFT.equals(startBracket)) {
                    if (SPLIT_EQU_RIGHT.equals(endBracket)) {
                        if (numberValue >= doubleValues[0] && numberValue < doubleValues[1]) {
                            return true;
                        }
                    } else if (SPLIT_EQ_RIGHT.equals(endBracket)) {
                        if (numberValue >= doubleValues[0] && numberValue <= doubleValues[1]) {
                            return true;
                        }
                    }
                }
            }
            return false;
        } catch (Exception e) {
            log.debug(e.getMessage(), e);
            return false;
        }
    
<no_super_class>