FieldPathIteratorHandler.ModificationStatus iterateNested(FieldPath fieldPath, int pos, FieldPathIteratorHandler handler, FieldValue complexFieldValue) {
        List<FieldValue> keysToRemove = new ArrayList<FieldValue>();
        boolean wasModified = false;

        if (pos < fieldPath.size()) {
            switch (fieldPath.get(pos).getType()) {
                case MAP_KEY:
                {
                    FieldValue val = values.get(fieldPath.get(pos).getLookupKey());
                    if (val != null) {
                        wasModified = checkAndRemove(fieldPath.get(pos).getLookupKey(), val.iterateNested(fieldPath, pos + 1, handler), wasModified, keysToRemove);
                    } else if (handler.createMissingPath()) {
                        val = getDataType().getValueType().createFieldValue();
                        FieldPathIteratorHandler.ModificationStatus status = val.iterateNested(fieldPath, pos + 1, handler);
                        if (status == FieldPathIteratorHandler.ModificationStatus.MODIFIED) {
                            put((K)fieldPath.get(pos).getLookupKey(), (V)val);
                            return status;
                        }
                    }
                    break;
                }
                case MAP_ALL_KEYS:
                    for (FieldValue f : values.keySet()) {
                        wasModified = checkAndRemove(f, f.iterateNested(fieldPath, pos + 1, handler), wasModified, keysToRemove);
                    }
                    break;
                case MAP_ALL_VALUES:
                    for (Map.Entry<K, V> entry : values.entrySet()) {
                        wasModified = checkAndRemove(entry.getKey(), entry.getValue().iterateNested(fieldPath, pos + 1, handler), wasModified, keysToRemove);
                    }
                    break;
                case VARIABLE:
                {
                    FieldPathIteratorHandler.IndexValue idx = handler.getVariables().get(fieldPath.get(pos).getVariableName());
                    if (idx != null) {
                        FieldValue val = values.get(idx.getKey());
                        if (val != null) {
                            wasModified = checkAndRemove(idx.getKey(), val.iterateNested(fieldPath, pos + 1, handler), wasModified, keysToRemove);
                        }
                    } else {
                        for (Map.Entry<K, V> entry : values.entrySet()) {
                            handler.getVariables().put(fieldPath.get(pos).getVariableName(), new FieldPathIteratorHandler.IndexValue(entry.getKey()));
                            wasModified = checkAndRemove(entry.getKey(), entry.getValue().iterateNested(fieldPath, pos + 1, handler), wasModified, keysToRemove);
                        }
                        handler.getVariables().remove(fieldPath.get(pos).getVariableName());
                    }
                    break;
                }
                default:
                    for (Map.Entry<K, V> entry : values.entrySet()) {
                        wasModified = checkAndRemove(entry.getKey(), entry.getKey().iterateNested(fieldPath, pos, handler), wasModified, keysToRemove);
                    }
                    break;
            }
        } else {
            FieldPathIteratorHandler.ModificationStatus status = handler.modify(complexFieldValue);
            if (status == FieldPathIteratorHandler.ModificationStatus.REMOVED) {
                return status;
            } else if (status == FieldPathIteratorHandler.ModificationStatus.MODIFIED) {
                wasModified = true;
            }

            if (handler.onComplex(complexFieldValue)) {
                for (Map.Entry<K, V> entry : values.entrySet()) {
                    wasModified = checkAndRemove(entry.getKey(), entry.getKey().iterateNested(fieldPath, pos, handler), wasModified, keysToRemove);
                }
            }
        }

        for (FieldValue f : keysToRemove) {
            values.remove(f);
        }

        return wasModified ? FieldPathIteratorHandler.ModificationStatus.MODIFIED : FieldPathIteratorHandler.ModificationStatus.NOT_MODIFIED;
    }
Checks if another object is equal to this set.

@param o the object to check for equality with
@return true if o is an instance of WeightedSet and the two encapsulated Maps are equal, false otherwise
document/src/main/java/com/yahoo/document/datatypes/MapFieldValue.java