public Rule parseRule(String input) throws ParseException {
        Matcher matcher = rulePattern.matcher(input);
        if (!matcher.matches()) {
            throw new ParseException(
                "The given input '" + input + "' is not a valid rule.");
        }

        List<Predicate> conditions = new ArrayList<Predicate>();
        if (matcher.groupCount() == 2 && matcher.group(2) != null) {
            conditions = parsePredicates(matcher.group(2));
        }

        return new Rule(parsePredicate(matcher.group(1)), conditions);
    }