### Question:
AbstractArithmeticRule extends AbstractRule { @Override public int hashCode() { return expression.hashCode(); } AbstractArithmeticRule(ArithmeticRuleExpression expression, Map<SummationVariable, Formula> filterClauses, String name); boolean hasSummation(); ArithmeticRuleExpression getExpression(); @Override boolean requiresSplit(); @Override List<Rule> split(); Set<Predicate> getBodyPredicates(); @Override int hashCode(); @Override boolean equals(Object other); @Override boolean supportsGroundingQueryRewriting(); @Override Formula getRewritableGroundingFormula(AtomManager atomManager); @Override boolean supportsIndividualGrounding(); @Override RawQuery getGroundingQuery(AtomManager atomManager); @Override void ground(Constant[] constants, Map<Variable, Integer> variableMap, AtomManager atomManager,
            List<GroundRule> results); @Override int groundAll(AtomManager atomManager, GroundRuleStore groundRuleStore);  }### Answer:
@Test public void testHash() { List<Coefficient> coefficients; List<SummationAtomOrAtom> atoms; coefficients = Arrays.asList((Coefficient)(new ConstantNumber(1))); atoms = Arrays.asList((SummationAtomOrAtom)(new QueryAtom(singleClosed, new Variable("A")))); ArithmeticRuleExpression expression1 = new ArithmeticRuleExpression( coefficients, atoms, FunctionComparator.EQ, new ConstantNumber(1)); coefficients = Arrays.asList((Coefficient)(new ConstantNumber(0))); atoms = Arrays.asList((SummationAtomOrAtom)(new QueryAtom(singleClosed, new Variable("A")))); ArithmeticRuleExpression expression2 = new ArithmeticRuleExpression( coefficients, atoms, FunctionComparator.EQ, new ConstantNumber(1)); coefficients = Arrays.asList((Coefficient)(new ConstantNumber(1))); atoms = Arrays.asList((SummationAtomOrAtom)(new QueryAtom(singleClosed, new Variable("A")))); ArithmeticRuleExpression expression3 = new ArithmeticRuleExpression( coefficients, atoms, FunctionComparator.EQ, new ConstantNumber(0)); coefficients = Arrays.asList((Coefficient)(new ConstantNumber(1))); atoms = Arrays.asList((SummationAtomOrAtom)(new QueryAtom(singleOpened, new Variable("A")))); ArithmeticRuleExpression expression4 = new ArithmeticRuleExpression( coefficients, atoms, FunctionComparator.EQ, new ConstantNumber(1)); assertNotEquals(expression1.hashCode(), expression2.hashCode()); assertNotEquals(expression1.hashCode(), expression3.hashCode()); assertNotEquals(expression1.hashCode(), expression4.hashCode()); assertNotEquals(expression2.hashCode(), expression3.hashCode()); assertNotEquals(expression2.hashCode(), expression4.hashCode()); assertNotEquals(expression3.hashCode(), expression4.hashCode()); }