PdxType implements DataSerializable { public boolean hasExtraFields(PdxType other) { for (PdxField ft : this.fields) { if (!ft.isDeleted() && other.getPdxField(ft.getFieldName()) == null) { return true; } } return false; } PdxType();  PdxType(String name, boolean expectDomainClass);  PdxType(PdxType copy); @Override void fromData(DataInput in); @Override void toData(DataOutput out); @Override int hashCode(); @Override boolean equals(Object other); boolean compatible(PdxType other); int getVariableLengthFieldCount(); String getClassName(); boolean getNoDomainClass(); void setNoDomainClass(boolean noDomainClass); int getTypeId(); int getDSId(); int getTypeNum(); void setTypeId(int tId); void setClassName(String className); void addField(PdxField ft); void initialize(PdxWriterImpl writer); PdxField getPdxField(String fieldName); List<PdxField> getFields(); PdxField getPdxFieldByIndex(int index); int getFieldCount(); int getUndeletedFieldCount(); String toFormattedString(); String toString(); List<Integer> getUnreadFieldIndexes(List<String> readFields); boolean hasExtraFields(PdxType other); SortedSet<PdxField> getSortedIdentityFields(); Collection<PdxField> getSortedFields(); List<String> getFieldNames(); void setAutoInfo(AutoClassInfo autoClassInfo); AutoClassInfo getAutoInfo(Class<?> c); void toStream(PrintStream printStream, boolean printFields); boolean getHasDeletedField(); void setHasDeletedField(boolean b);  }
@Test public void testHasExtraFields() { final PdxType type = new PdxType(TYPE_NAME, EXPECT_DOMAIN_CLASS); type.setHasDeletedField(true); type.addField(FIELD_3); type.addField(FIELD_2); type.addField(FIELD_1); type.addField(FIELD_0); assertFalse(type.hasExtraFields(type)); final PdxType noDeletedField = new PdxType(TYPE_NAME, EXPECT_DOMAIN_CLASS); noDeletedField.addField(FIELD_2); noDeletedField.addField(FIELD_1); noDeletedField.addField(FIELD_0); assertFalse(type.hasExtraFields(noDeletedField)); final PdxType fewerFields = new PdxType(TYPE_NAME, EXPECT_DOMAIN_CLASS); fewerFields.addField(FIELD_2); fewerFields.addField(FIELD_1); assertTrue(type.hasExtraFields(fewerFields)); final PdxType moreFields = new PdxType(TYPE_NAME, EXPECT_DOMAIN_CLASS); moreFields.addField(FIELD_4); moreFields.addField(FIELD_2); moreFields.addField(FIELD_1); moreFields.addField(FIELD_0); assertFalse(type.hasExtraFields(moreFields)); }