@Override
    public boolean contains(FieldSet o) {
        if (o instanceof NoFields || o instanceof DocIdOnly) {
            return true;
        }

        if (o instanceof Field) {
            return equals(o);
        }

        return false;
    }
Two fields are equal if they have the same name and the same data type
document/src/main/java/com/yahoo/document/Field.java