### Question:
NubDb { public long countTaxa() { Result res = dao.getNeo().execute("MATCH (n) RETURN count(n) as cnt"); return (long) res.columnAs("cnt").next(); } private  NubDb(UsageDao dao, AuthorComparator authorComparator, boolean initialize); static NubDb create(UsageDao dao, AuthorComparator authorComparator); static NubDb open(UsageDao dao, AuthorComparator authorComparator); UsageDao dao(); Transaction beginTx(); NubUsage parent(NubUsage child); NubUsage kingdom(Kingdom kingdom); Node parent(Node child); List<Node> parents(Node n); Map<Rank, String> parentsMap(Node n); Node getNode(long id); NubUsageMatch findAcceptedNubUsage(Kingdom kingdom, final String canonical, Rank rank); NubUsageMatch findNubUsage(final String canonical, Rank rank, Kingdom kingdom, boolean inclSynonyms); List<NubUsage> listNubUsages(final String canonical, @Nullable Rank rank, @Nullable Kingdom kingdom, boolean inclSynonyms, boolean excludeDoubtfulIfOtherMatches); NubUsageMatch findNubUsage(UUID currSource, SrcUsage u, Kingdom uKingdom, NubUsage currNubParent); NubUsageMatch findNubUsage(UUID currSource, ParsedName pn, @Nullable Rank rank, TaxonomicStatus status, Kingdom kingdom, @Nullable NubUsage currNubParent); long countTaxa(); NubUsage addUsage(NubUsage parent, SrcUsage src, Origin origin, UUID sourceDatasetKey, NameUsageIssue... issues); NubUsage addUsage(NubUsage parent, NubUsage nub); NubUsage addRoot(NubUsage nub); boolean createParentRelation(NubUsage n, NubUsage parent); Relationship setSingleFromRelationship(Node from, Node to, RelType reltype); Relationship createSynonymRelation(Node synonym, Node accepted); boolean deleteRelations(Node n, RelType type, Direction direction); void transferChildren(NubUsage target, NubUsage source); void convertToSynonym(NubUsage u, NubUsage accepted, TaxonomicStatus synStatus, @Nullable NameUsageIssue issue); NubUsage store(NubUsage nub); boolean existsInClassification(Node n, Node search, boolean fuzzyFamily); List<NubUsage> listBasionymGroup(Node bas);  }### Answer:
@Test public void testCountTaxa() throws Exception { UsageDao dao = UsageDao.temporaryDao(10); NubDb nub = NubDb.create(dao, AuthorComparator.createWithoutAuthormap()); try (Transaction tx = dao.beginTx()) { assertEquals(0l, nub.countTaxa()); NubUsage u = new NubUsage(); u.parsedName = new ParsedName(); u.origin = Origin.SOURCE; u.rank = Rank.SPECIES; nub.addRoot(u); assertEquals(1l, nub.countTaxa()); nub.addRoot(u); assertEquals(1l, nub.countTaxa()); u.node = null; nub.addRoot(u); assertEquals(2l, nub.countTaxa()); tx.success(); } }