### Question:
Atom implements Formula, SummationAtomOrAtom { public int getArity() { return predicate.getArity(); } protected  Atom(Predicate predicate, Term[] args); Predicate getPredicate(); int getArity(); Term[] getArguments(); Set<Variable> getVariables(); @Override Formula getDNF(); @Override Set<Atom> getAtoms(Set<Atom> atoms); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object oth); @Override Formula flatten();  }### Answer:
@Test public void testEqualityArgs() { Predicate singleInt = StandardPredicate.get("SingleInt", new ConstantType[]{ConstantType.Integer}); Predicate doubleInt = StandardPredicate.get("DoubleInt", new ConstantType[]{ConstantType.Integer, ConstantType.Integer}); Term[] singleArray1 = new Term[1]; Term[] singleArray2 = new Term[1]; Term[] doubleArray1 = new Term[2]; Term[] doubleArray2 = new Term[2]; Atom[] atoms = new Atom[16]; Term term1 = null; Term term2 = null; Term term3 = null; Term term4 = null; term1 = new IntegerAttribute(1); term2 = new IntegerAttribute(2); singleArray1[0] = term1; doubleArray1[0] = term1; doubleArray1[1] = term2; atoms[0] = new QueryAtom(singleInt, singleArray1); atoms[1] = new QueryAtom(singleInt, singleArray1); atoms[2] = new QueryAtom(doubleInt, doubleArray1); atoms[3] = new QueryAtom(doubleInt, doubleArray1); term1 = new IntegerAttribute(1); term2 = new IntegerAttribute(1); term3 = new IntegerAttribute(2); term4 = new IntegerAttribute(2); singleArray1[0] = term1; doubleArray1[0] = term1; doubleArray1[1] = term3; atoms[4] = new QueryAtom(singleInt, singleArray1); atoms[5] = new QueryAtom(doubleInt, doubleArray1); singleArray1[0] = term2; doubleArray1[0] = term2; doubleArray1[1] = term4; atoms[6] = new QueryAtom(singleInt, singleArray1); atoms[7] = new QueryAtom(doubleInt, doubleArray1); term1 = new IntegerAttribute(1); term2 = new IntegerAttribute(2); singleArray1[0] = term1; singleArray2[0] = term1; doubleArray1[0] = term1; doubleArray1[1] = term2; doubleArray2[0] = term1; doubleArray2[1] = term2; atoms[8] = new QueryAtom(singleInt, singleArray1); atoms[9] = new QueryAtom(singleInt, singleArray2); atoms[10] = new QueryAtom(doubleInt, doubleArray1); atoms[11] = new QueryAtom(doubleInt, doubleArray2); term1 = new IntegerAttribute(1); term2 = new IntegerAttribute(1); term3 = new IntegerAttribute(2); term4 = new IntegerAttribute(2); singleArray1[0] = term1; doubleArray1[0] = term1; doubleArray1[1] = term3; atoms[12] = new QueryAtom(singleInt, singleArray1); atoms[13] = new QueryAtom(doubleInt, doubleArray1); singleArray2[0] = term2; doubleArray2[0] = term2; doubleArray2[1] = term4; atoms[14] = new QueryAtom(singleInt, singleArray2); atoms[15] = new QueryAtom(doubleInt, doubleArray2); for (int i = 0; i < atoms.length; i++) { for (int j = 0; j < atoms.length; j++) { if (atoms[i].getArity() == atoms[j].getArity()) { assertEquals(atoms[i], atoms[j]); } else { assertNotEquals(atoms[i], atoms[j]); } } } }