core/src/main/java/org/sakaiproject/nakamura/api/lite/StorageClientUtils.java
@SuppressWarnings("unchecked")
    public static Map<String, Object> getFilteredAndEcodedMap(Map<String, Object> source,
            Set<String> filter) {
        Map<String, Object> filteredMap = Maps.newHashMap();
        for (Entry<String, Object> e : source.entrySet()) {
            if (!filter.contains(e.getKey())) {
                Object o = e.getValue();
                if (o instanceof Map) {
                    filteredMap.put(e.getKey(),
                            getFilteredAndEcodedMap((Map<String, Object>) o, filter));
                } else {
                    filteredMap.put(e.getKey(), o);
                }
            }
        }
        return filteredMap;
    }
@SuppressWarnings("unchecked")
    public static Map<String, Object> getFilteredAndEcodedMap(Map<String, Object> source,
            Set<String> filter) {
        Map<String, Object> filteredMap = Maps.newHashMap();
        for (Entry<String, Object> e : source.entrySet()) {
            if (!filter.contains(e.getKey())) {
                Object o = e.getValue();
                if (o instanceof Map) {
                    filteredMap.put(e.getKey(),
                            getFilteredAndEcodedMap((Map<String, Object>) o, filter));
                } else {
                    filteredMap.put(e.getKey(), o);
                }
            }
        }
        return filteredMap;
    }
Converts a map into Map or byte[] values with String keys. No control
over depth of nesting. Keys in the filter set are not transfered
Resulting map is mutable.

@param source a map of values to modify
@param filter a map of values to remove by key from source
@return the map less any keys from filter