### Question:
RelationshipList extends ArrayList<Relationship> { public Relationship getShallowest() { if (shallowestIndex >= 0) { return get(shallowestIndex); } return null; } RelationshipList(); @Override boolean add(Relationship relationship); Relationship getShallowest(); Relationship getDeepest();  }### Answer:
@Test public void testGetShallowest() throws JWNLException { RelationshipList l = new RelationshipList(); Assert.assertNull(l.getShallowest()); Assert.assertNull(l.getDeepest()); Relationship r = new SymmetricRelationship(PointerType.ANTONYM, new PointerTargetNodeList(Arrays.asList(new PointerTargetNode(new Synset(null, POS.NOUN)))), new Synset(null, POS.NOUN), new Synset(null, POS.NOUN)); l.add(r); Assert.assertEquals(r, l.getDeepest()); Assert.assertEquals(r, l.getShallowest()); Relationship rr = new SymmetricRelationship(PointerType.ANTONYM, new PointerTargetNodeList(), new Synset(null, POS.NOUN), new Synset(null, POS.NOUN)); l.add(rr); Assert.assertEquals(r, l.getDeepest()); Assert.assertEquals(rr, l.getShallowest()); }