@VisibleForTesting
  Set<PartitionFieldNode> getRoots() {
    return roots;
  }
@Test
  public void testPartitionFieldTree() throws MetaException {
    PersistenceManager mockPm = Mockito.mock(PersistenceManager.class);
    List<String> projectionFields = new ArrayList<>(2);
    projectionFields.add("sd.location");
    projectionFields.add("sd.parameters");
    projectionFields.add("createTime");
    projectionFields.add("sd.serdeInfo.serializationLib");
    projectionFields.add("sd.cols");
    projectionFields.add("parameters");
    PartitionProjectionEvaluator projectionEvaluator =
        new PartitionProjectionEvaluator(mockPm, fieldNameToColumnName, projectionFields, false,
            false, null, null);
    Set<PartitionFieldNode> roots = projectionEvaluator.getRoots();

    Set<PartitionFieldNode> expected = new HashSet<>();
    PartitionFieldNode sdNode = new PartitionFieldNode("sd");
    sdNode.addChild(new PartitionFieldNode("sd.location"));
    sdNode.addChild(new PartitionFieldNode("sd.parameters", true));
    PartitionFieldNode sdColsNodes = new PartitionFieldNode("sd.cols", true);
    sdColsNodes.addChild(new PartitionFieldNode("sd.cols.name", true));
    sdColsNodes.addChild(new PartitionFieldNode("sd.cols.type", true));
    sdColsNodes.addChild(new PartitionFieldNode("sd.cols.comment", true));
    sdNode.addChild(sdColsNodes);

    PartitionFieldNode serdeNode = new PartitionFieldNode("sd.serdeInfo");
    serdeNode.addChild(new PartitionFieldNode("sd.serdeInfo.serializationLib"));

    sdNode.addChild(serdeNode);
    expected.add(sdNode);
    expected.add(new PartitionFieldNode("parameters", true));
    expected.add(new PartitionFieldNode("createTime"));
    expected.add(new PartitionFieldNode("PART_ID"));
    expected.add(new PartitionFieldNode("SD_ID"));
    expected.add(new PartitionFieldNode("CD_ID"));
    expected.add(new PartitionFieldNode("SERDE_ID"));
    compare(expected, roots);
  }