public void testReplaceTaxoWithLargeTaxonomy() throws Exception {
Directory srcTaxoDir = newDirectory(), targetTaxoDir = newDirectory();
// build source, large, taxonomy
DirectoryTaxonomyWriter taxoWriter = new DirectoryTaxonomyWriter(srcTaxoDir);
int ord = taxoWriter.addCategory(new FacetLabel("A", "1", "1", "1", "1", "1", "1"));
taxoWriter.close();
taxoWriter = new DirectoryTaxonomyWriter(targetTaxoDir);
int ordinal = taxoWriter.addCategory(new FacetLabel("B", "1"));
assertEquals(1, taxoWriter.getParent(ordinal)); // call getParent to initialize taxoArrays
taxoWriter.commit();
taxoWriter.replaceTaxonomy(srcTaxoDir);
assertEquals(ord - 1, taxoWriter.getParent(ord));