### Question:
AbstractLogicalRule extends AbstractRule { @Override public int hashCode() { return hash; } AbstractLogicalRule(Formula formula, String name); Formula getFormula(); DNFClause getNegatedDNF(); @Override int groundAll(AtomManager atomManager, GroundRuleStore groundRuleStore); @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); int groundAll(QueryResultIterable groundVariables, AtomManager atomManager, GroundRuleStore groundRuleStore); @Override int hashCode(); @Override boolean equals(Object other);  }### Answer:
@Test public void testHash() { AbstractLogicalRule rule1 = new WeightedLogicalRule( new Implication( new QueryAtom(singleClosed, new Variable("A")), new QueryAtom(singleOpened, new Variable("A")) ), 1.0, true ); AbstractLogicalRule rule2 = new WeightedLogicalRule( new Implication( new QueryAtom(singleOpened, new Variable("A")), new QueryAtom(singleClosed, new Variable("A")) ), 1.0, true ); AbstractLogicalRule rule3 = new WeightedLogicalRule( new Implication( new Negation(new QueryAtom(singleOpened, new Variable("A"))), new Negation(new QueryAtom(singleClosed, new Variable("A"))) ), 1.0, true ); assertNotEquals(rule1.hashCode(), rule2.hashCode()); assertEquals(rule1.hashCode(), rule3.hashCode()); assertNotEquals(rule2.hashCode(), rule3.hashCode()); }