### Question:
DocumentRevisionTree { public DocumentRevisionTree add(InternalDocumentRevision documentRevision) { Misc.checkArgument(!sequenceMap.containsKey(documentRevision.getSequence()), "The revision must not be added to the tree before."); if(documentNumericId == -1l && docId == null){ documentNumericId = documentRevision.getInternalNumericId(); docId = documentRevision.getId(); } else if (!(documentRevision.getInternalNumericId() == documentNumericId || documentRevision.getId().equals(docId))) { throw new IllegalArgumentException("Document revision is not part of the same tree"); } if(documentRevision.getParent() <= 0) { addRootDBObject(documentRevision); } else { addNode(documentRevision); } return this; } DocumentRevisionTree();  DocumentRevisionTree(InternalDocumentRevision documentRevision); DocumentRevisionTree add(InternalDocumentRevision documentRevision); InternalDocumentRevision lookup(String id, String rev); int depth(long sequence); InternalDocumentRevision lookupChildByRevId(InternalDocumentRevision parentNode, String childRevision); InternalDocumentRevision bySequence(long sequence); boolean hasConflicts(); Map<Long, DocumentRevisionNode> roots(); DocumentRevisionNode root(long sequence); List<DocumentRevisionNode> leafs(); Set<String> leafRevisionIds(); List<InternalDocumentRevision> leafRevisions(); List<InternalDocumentRevision> leafRevisions(boolean excludeDeleted); InternalDocumentRevision getCurrentRevision(); List<InternalDocumentRevision> getPathForNode(long sequence); List<String> getPath(long sequence); String getDocId();  }### Answer:
@Test(expected = IllegalArgumentException.class) public void constructor_invalidRootNode2() { DocumentRevisionTree t = new DocumentRevisionTree(); t.add(c2); }
@Test(expected = IllegalArgumentException.class) public void add_wrongOrder_exception () { DocumentRevisionTree t = new DocumentRevisionTree(c1); t.add(c3); }
@Test(expected = IllegalArgumentException.class) public void add_sameNodeAddedTwice_exception () { DocumentRevisionTree t = new DocumentRevisionTree(c1); t.add(c1); }