public int separate(File starTreeOutputDir, StarTreeV2BuilderConfig builderConfig)
      throws IOException {
    int treeIndex = _builderConfigList.indexOf(builderConfig);
    if (treeIndex == -1) {
      LOGGER.info("No existing star-tree found for config: {}", builderConfig);
      return -1;
    }
    LOGGER.info("Separating star-tree for config: {}", builderConfig);
    separate(starTreeOutputDir, treeIndex);
    return _numDocsList.get(treeIndex);
  }
@Test
  public void testSeparate()
      throws Exception {
    URL segmentUrl = getClass().getClassLoader().getResource(SEGMENT_PATH);
    assertNotNull(segmentUrl);
    File segmentDir = new File(segmentUrl.getFile());
    try (StarTreeIndexSeparator separator = new StarTreeIndexSeparator(
        new File(segmentDir, StarTreeV2Constants.INDEX_MAP_FILE_NAME),
        new File(segmentDir, StarTreeV2Constants.INDEX_FILE_NAME),
        new SegmentMetadataImpl(segmentDir).getStarTreeV2MetadataList())) {
      separator.separate(TEMP_DIR, BUILDER_CONFIG);
    }
    String[] fileNames = TEMP_DIR.list();
    assertNotNull(fileNames);
    Set<String> fileNameSet = new HashSet<>(Arrays.asList(fileNames));
    assertTrue(fileNameSet.contains(STAR_TREE_INDEX_FILE_NAME));
    BUILDER_CONFIG.getDimensionsSplitOrder()
        .forEach(dimension -> assertTrue(fileNameSet.contains(dimension + UNSORTED_SV_FORWARD_INDEX_FILE_EXTENSION)));
    BUILDER_CONFIG.getFunctionColumnPairs()
        .forEach(dimension -> assertTrue(fileNameSet.contains(dimension + RAW_SV_FORWARD_INDEX_FILE_EXTENSION)));
  }