### Question:
AvroExhibit { public static ExhibitDescriptor createDescriptor(Schema schema) { List<ObsDescriptor.Field> fields = Lists.newArrayList(); Map<String, ObsDescriptor> frames = Maps.newHashMap(); Map<String, FieldType> vectors = Maps.newHashMap(); for (int i = 0; i < schema.getFields().size(); i++) { Schema.Field f = schema.getFields().get(i); Schema unwrapped = AvroObsDescriptor.unwrap(f.schema()); if (unwrapped.getType() == Schema.Type.ARRAY) { Schema elementType = unwrapped.getElementType(); if(isRecordElement(elementType)) { frames.put(f.name(), new AvroObsDescriptor(getRecordElement(elementType))); } else { vectors.put(f.name(), AvroObsDescriptor.getFieldType(elementType)); } } else { FieldType ft = AvroObsDescriptor.getFieldType(unwrapped); if (ft != null) { fields.add(new ObsDescriptor.Field(f.name(), ft)); } } } return new ExhibitDescriptor(new SimpleObsDescriptor(fields), frames, vectors); } private  AvroExhibit(); static ExhibitDescriptor createDescriptor(Schema schema); static Exhibit create(GenericRecord record); static Schema.Field getSchemaField(ObsDescriptor.Field f); static Schema getSchema(FieldType type);  }### Answer:
@Test public void testExhibitDescriptorFrame() { List<ExhibitDescriptor> descriptors = ImmutableList.of( AvroExhibit.createDescriptor(outer1) , AvroExhibit.createDescriptor(outer2)); for(ExhibitDescriptor desc: descriptors){ ObsDescriptor attributes = desc.attributes(); assertEquals("Infer number of attributes", 2, attributes.size()); assertEquals(new Field("id", FieldType.INTEGER), attributes.get(0)); assertEquals(new Field("short", FieldType.STRING), attributes.get(1)); Map<String, ObsDescriptor> frames = desc.frames(); assertEquals("Infer number of frames", 1, frames.size()); ObsDescriptor frameDesc = frames.get("ifoo"); assertNotNull("Retrieve `ifoo` Frame", frameDesc); assertEquals("Infer Frame Structure", 3, frameDesc.size()); assertEquals(new Field("f1", FieldType.STRING), frameDesc.get(frameDesc.indexOf("f1"))); assertEquals(new Field("f2", FieldType.BOOLEAN), frameDesc.get(frameDesc.indexOf("f2"))); assertEquals(new Field("f3", FieldType.INTEGER), frameDesc.get(frameDesc.indexOf("f3"))); Map<String, FieldType> vectors = desc.vectors(); assertEquals("Infer number of vectors", 0, vectors.size()); } }