public static TypeDescriptor javaTypeForFieldType(FieldType fieldType) {
    switch (fieldType.getTypeName()) {
      case LOGICAL_TYPE:
        // TODO: shouldn't we handle this differently?
        return javaTypeForFieldType(fieldType.getLogicalType().getBaseType());
      case ARRAY:
        return TypeDescriptors.lists(javaTypeForFieldType(fieldType.getCollectionElementType()));
      case ITERABLE:
        return TypeDescriptors.iterables(
            javaTypeForFieldType(fieldType.getCollectionElementType()));
      case MAP:
        return TypeDescriptors.maps(
            javaTypeForFieldType(fieldType.getMapKeyType()),
            javaTypeForFieldType(fieldType.getMapValueType()));
      case ROW:
        return TypeDescriptors.rows();
      default:
        return PRIMITIVE_MAPPING.get(fieldType.getTypeName());
    }
  }
@Test
  public void testIterableTypeToJavaType() {
    assertEquals(
        TypeDescriptors.iterables(TypeDescriptors.longs()),
        FieldTypeDescriptors.javaTypeForFieldType(FieldType.iterable(FieldType.INT64)));
    assertEquals(
        TypeDescriptors.iterables(TypeDescriptors.iterables(TypeDescriptors.longs())),
        FieldTypeDescriptors.javaTypeForFieldType(
            FieldType.iterable(FieldType.iterable(FieldType.INT64))));
  }