private boolean fieldsAreEqual(HollowEffigy fromElement, HollowEffigy toElement, int[] fromFieldPath, int[] toFieldPath) {
HollowObjectTypeDataAccess fromDataAccess = (HollowObjectTypeDataAccess) fromElement.getDataAccess();
int fromOrdinal = fromElement.getOrdinal();
HollowObjectTypeDataAccess toDataAccess = (HollowObjectTypeDataAccess) toElement.getDataAccess();
int toOrdinal = toElement.getOrdinal();
HollowObjectSchema fromSchema = fromDataAccess.getSchema();
HollowObjectSchema toSchema = toDataAccess.getSchema();
for (int i = 0; i < fromFieldPath.length - 1; i++) {
int fromFieldPosition = fromFieldPath[i];
int toFieldPosition = toFieldPath[i];
fromOrdinal = fromDataAccess.readOrdinal(fromOrdinal, fromFieldPosition);
toOrdinal = toDataAccess.readOrdinal(toOrdinal, toFieldPosition);
fromDataAccess = (HollowObjectTypeDataAccess) fromDataAccess.getDataAccess().getTypeDataAccess(fromSchema.getReferencedType(fromFieldPosition));
toDataAccess = (HollowObjectTypeDataAccess) toDataAccess.getDataAccess().getTypeDataAccess(toSchema.getReferencedType(toFieldPosition));
fromSchema = fromDataAccess.getSchema();
toSchema = toDataAccess.getSchema();
}
return HollowReadFieldUtils.fieldsAreEqual(fromDataAccess, fromOrdinal, fromFieldPath[fromFieldPath.length-1], toDataAccess, toOrdinal, toFieldPath[toFieldPath.length-1]);
}