### Question:
AsymmetricRelationship extends Relationship { public Relationship reverse() throws CloneNotSupportedException { PointerTargetNodeList list = getNodeList().deepClone().reverse(); int commonParentIndex = (list.size() - 1) - getCommonParentIndex(); for (int i = 0; i < list.size(); i++) { if (i != commonParentIndex) { list.get(i).setType(getType().getSymmetricType()); } } return new AsymmetricRelationship(getType(), list, commonParentIndex, getSourceSynset(), getTargetSynset()); } AsymmetricRelationship(
            PointerType type, PointerTargetNodeList nodes, int commonParentIndex, Synset sourceSynset, Synset targetSynset); int getCommonParentIndex(); int getRelativeTargetDepth(); Relationship reverse();  }### Answer:
@Test public void testReverse() throws JWNLException, CloneNotSupportedException { dictionary.edit(); Synset s1 = dictionary.createSynset(POS.NOUN); Synset s2 = dictionary.createSynset(POS.NOUN); Synset s3 = dictionary.createSynset(POS.NOUN); AsymmetricRelationship r = new AsymmetricRelationship(PointerType.HYPERNYM, new PointerTargetNodeList(Arrays.asList( new PointerTargetNode(s1, PointerType.HYPERNYM), new PointerTargetNode(s2, PointerType.HYPERNYM), new PointerTargetNode(s3, PointerType.HYPONYM) )), 1, s1, s2); Relationship rev = r.reverse(); Assert.assertEquals(3, rev.getSize()); Assert.assertEquals(3, rev.getNodeList().size()); Assert.assertEquals(PointerType.HYPONYM, rev.getNodeList().get(0).getType()); Assert.assertEquals(PointerType.HYPERNYM, rev.getNodeList().get(1).getType()); Assert.assertEquals(PointerType.HYPONYM, rev.getNodeList().get(2).getType()); }