@Override
    public void filterExisting(Map<String, String[]> data) {
        //this is somewhat costly, but it ensures that
        //metadata that was placed in the metadata object before this
        //filter was applied is removed.
        //It should only be called once, and probably not on that
        //many fields.
        Map<String, String[]> tmp = new HashMap<>();
        for (Map.Entry<String, String[]> e : data.entrySet()) {
            String name = e.getKey();
            String[] vals = e.getValue();
            if (! includeField(name)) {
                continue;
            }
            for (int i = 0; i < vals.length; i++) {
                String v = vals[i];
                if (include(name, v)) {
                    add(name, v, tmp);
                }
            }
        }
        data.clear();
        data.putAll(tmp);
    }
@param maxKeySize maximum key size in UTF-16 bytes-- keys will be truncated to this
                  length; if less than 0, keys will not be truncated
@param maxEstimatedSize
@param includeFields if null or empty, all fields are included; otherwise, which fields
                     to add to the metadata object.
@param excludeFields these fields will not be included (unless they're in {@link StandardWriteFilter#ALWAYS_SET_FIELDS})
@param includeEmpty if <code>true</code>, this will set or add an empty value to the
                    metadata object.
tika-core/src/main/java/org/apache/tika/metadata/writefilter/StandardWriteFilter.java