TypeReport { @JsonCreator public TypeReport( @JsonProperty( "klass" ) Class<?> klass ) { this.klass = klass; } @JsonCreator  TypeReport( @JsonProperty( "klass" ) Class<?> klass ); void merge( TypeReport typeReport ); void addObjectReport( ObjectReport objectReport ); @JsonProperty @JacksonXmlProperty( isAttribute = true ) Class<?> getKlass(); @JsonProperty @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 ) Stats getStats(); @JsonProperty @JacksonXmlElementWrapper( localName = "objectReports", namespace = DxfNamespaces.DXF_2_0 ) @JacksonXmlProperty( localName = "objectReport", namespace = DxfNamespaces.DXF_2_0 ) List<ObjectReport> getObjectReports(); @JsonProperty @JacksonXmlElementWrapper( localName = "objectReports", namespace = DxfNamespaces.DXF_2_0 ) @JacksonXmlProperty( localName = "objectReport", namespace = DxfNamespaces.DXF_2_0 ) void setObjectReports( List<ObjectReport> objectReports ); List<ErrorReport> getErrorReports(); Map<Integer, ObjectReport> getObjectReportMap(); @Override String toString();  }
@Test public void testTypeReport() { ObjectReport objectReport0 = new ObjectReport( DataElement.class, 0 ); ObjectReport objectReport1 = new ObjectReport( DataElement.class, 1 ); ObjectReport objectReport2 = new ObjectReport( DataElement.class, 2 ); objectReport0.addErrorReport( new ErrorReport( DataElementGroup.class, ErrorCode.E3000, "admin", "DataElementGroup" ) ); objectReport1.addErrorReport( new ErrorReport( DataElementGroup.class, ErrorCode.E3000, "admin", "DataElementGroup" ) ); objectReport2.addErrorReport( new ErrorReport( DataElementGroup.class, ErrorCode.E3000, "admin", "DataElementGroup" ) ); TypeReport typeReport0 = new TypeReport( DataElement.class ); typeReport0.addObjectReport( objectReport0 ); typeReport0.addObjectReport( objectReport1 ); typeReport0.addObjectReport( objectReport2 ); assertEquals( 3, typeReport0.getObjectReports().size() ); assertEquals( 3, typeReport0.getErrorReports().size() ); ObjectReport objectReport3 = new ObjectReport( DataElement.class, 3 ); ObjectReport objectReport4 = new ObjectReport( DataElement.class, 4 ); ObjectReport objectReport5 = new ObjectReport( DataElement.class, 5 ); objectReport3.addErrorReport( new ErrorReport( DataElementGroup.class, ErrorCode.E3000, "admin", "DataElementGroup" ) ); objectReport4.addErrorReport( new ErrorReport( DataElementGroup.class, ErrorCode.E3000, "admin", "DataElementGroup" ) ); objectReport5.addErrorReport( new ErrorReport( DataElementGroup.class, ErrorCode.E3000, "admin", "DataElementGroup" ) ); TypeReport typeReport1 = new TypeReport( DataElement.class ); typeReport1.addObjectReport( objectReport0 ); typeReport1.addObjectReport( objectReport1 ); typeReport1.addObjectReport( objectReport2 ); assertEquals( 3, typeReport1.getObjectReports().size() ); assertEquals( 3, typeReport1.getErrorReports().size() ); }