### Question:
IndexMatch implements WritableComparable<IndexMatch> { public void add(JexlNode node) { nodeSet.add(node); } IndexMatch(final String uid); protected  IndexMatch();  IndexMatch(final String uid, final JexlNode myNode);  IndexMatch(final String uid, final JexlNode myNode, final String shard);  IndexMatch(final String uid, final JexlNode myNode, final IndexMatchType type);  IndexMatch(Set<JexlNode> nodes, String uid, final IndexMatchType type); String getUid(); JexlNode getNode(); @Override int hashCode(); @Override boolean equals(Object obj); @Override int compareTo(IndexMatch other); void setType(IndexMatchType type); void set(JexlNode node); void add(JexlNode node); @Override String toString(); @Override void readFields(DataInput in); @Override void write(DataOutput out);  }### Answer:
@Test public void testSetOfIndexMatches() { JexlNode node = JexlNodeFactory.buildEQNode("FOO", "bar"); JexlNode otherNode = JexlNodeFactory.buildEQNode("FOO2", "bar2"); IndexMatch match1 = new IndexMatch("uid0"); IndexMatch match2 = new IndexMatch("uid0"); match1.add(node); match2.add(otherNode); Set<IndexMatch> matchSet = new HashSet<>(); matchSet.add(match1); matchSet.add(match2); assertEquals(2, matchSet.size()); Iterator<IndexMatch> matchIter = matchSet.iterator(); assertEquals(Collections.singleton("FOO == 'bar'"), matchIter.next().nodeSet.getNodeKeys()); assertEquals(Collections.singleton("FOO2 == 'bar2'"), matchIter.next().nodeSet.getNodeKeys()); }