public FieldsPath() {
    this(new ArrayList<ThriftField>());
  }
@Test
  public void testFieldsPath() {
    StructType person = ThriftSchemaConverter.toStructType(Person.class);

    List<String> paths = PrimitivePathVisitor.visit(person, ".");
    assertEquals(
        Arrays.asList("name.first_name", "name.last_name", "id", "email", "phones.number", "phones.type"),
        paths);

    paths = PrimitivePathVisitor.visit(person, "/");
    assertEquals(
        Arrays.asList("name/first_name", "name/last_name", "id", "email", "phones/number", "phones/type"),
        paths);

    StructType structInMap = ThriftSchemaConverter.toStructType(TestStructInMap.class);

    paths = PrimitivePathVisitor.visit(structInMap, ".");
    assertEquals(
        Arrays.asList(
            "name",
            "names.key",
            "names.value.name.first_name",
            "names.value.name.last_name",
            "names.value.phones.key",
            "names.value.phones.value",
            "name_to_id.key",
            "name_to_id.value"),
        paths);

    paths = PrimitivePathVisitor.visit(structInMap, "/");
    assertEquals(
        Arrays.asList(
            "name",
            "names/key",
            "names/value/name/first_name",
            "names/value/name/last_name",
            "names/value/phones/key",
            "names/value/phones/value",
            "name_to_id/key",
            "name_to_id/value"),
        paths);
  }