### Question:
ParentStack { public void clear() { nubMap.clear(); parents.clear(); currParent = null; currKingdom = Kingdom.INCERTAE_SEDIS; } ParentStack(NubUsage unknownKingdom); NubUsage nubParent(); Kingdom nubKingdom(); int size(); void add(SrcUsage src); boolean parentInNub(); LinkedList<SrcUsage> getParents(); void put(NubUsage nub); void clear();  }### Answer:
@Test public void testClear() throws Exception { ParentStack parents = new ParentStack(null); assertEquals(0, parents.size()); assertNull(parents.nubParent()); parents.add(src(1, null)); parents.add(src(2, 1)); NubUsage nub = nub("nub#3"); parents.put(nub); assertNull(parents.nubParent()); parents.add(src(3, 2)); assertEquals(3, parents.size()); assertEquals(nub, parents.nubParent()); parents.add(src(4, 1)); assertEquals(2, parents.size()); assertNull(parents.nubParent()); }