Returns a multimap with all empty strings (as keys or values) replaced by a non-empty human
understandable indicator for an empty string.

<p>Returns the given multimap if it contains no empty strings.
974818
private static Multimap<?, ?> annotateEmptyStringsMultimap(Multimap<?, ?> multimap) {
    if (multimap.containsKey("") || multimap.containsValue("")) {
      ListMultimap<Object, Object> annotatedMultimap = LinkedListMultimap.create();
      for (Entry<?, ?> entry : multimap.entries()) {
        Object key = "".equals(entry.getKey()) ? HUMAN_UNDERSTANDABLE_EMPTY_STRING : entry.getKey();
        Object value =
            "".equals(entry.getValue()) ? HUMAN_UNDERSTANDABLE_EMPTY_STRING : entry.getValue();
        annotatedMultimap.put(key, value);
      }
      return annotatedMultimap;
    } else {
      return multimap;
    }
  }
1032964
@SuppressWarnings({
			"unchecked", "rawtypes"
	})
	public Map<String, String> getStringMap(final Class<? extends Map> clazz) {
		try {
			final Map<String, String> map = clazz.newInstance();
			final int len = getVInt();
			for (int i = 0; i < len; i++) {
				map.put(getString(), getString());
			}
			return map;
		} catch (InstantiationException e) {
			throw new IllegalArgumentException("Invalid class", e);
		} catch (IllegalAccessException e) {
			throw new IllegalArgumentException("Invalid class", e);
		}
	}
214133
public Map<String, String> toKeyValueMap() {
        Map<String, String> valueMap = new HashMap<String, String>();
        String[] tokens;
        
        if (selectorString.contains(" AND")) {
            String[] chunks = selectorString.split(" AND");
            for (String chunk : chunks) {
                tokens = escapeEqualsFromXpathNodeTest(chunk).split("=");
                valueMap.put(unescapeEqualsFromXpathNodeTest(tokens[0].trim()), tokens[1].trim().substring(1, tokens[1].trim().length() -1));
            }
        } else {
            tokens = escapeEqualsFromXpathNodeTest(selectorString).split("=");
            valueMap.put(unescapeEqualsFromXpathNodeTest(tokens[0].trim()), tokens[1].trim().substring(1, tokens[1].trim().length() -1));
        }
        
        return valueMap;
    }
707202
@SuppressWarnings("rawtypes")
    @Override
    public boolean getIsEmpty() {

        if (m_object == null) {
            // this is the case for non existing values
            return true;
        } else if (m_object instanceof String) {
            // return values for String
            return CmsStringUtil.isEmpty((String)m_object);
        } else if (m_object instanceof Collection) {
            // if a collection has any entries it is not emtpy
            return !((Collection)m_object).isEmpty();
        } else {
            // assume all other non-null objects are not empty
            return false;
        }
    }
1372528
public Map<String, String> getKeywordMap() {
        if (keywords == null) {
            TreeMap<String, String> m = null;
            if (setToKeywordStart()) {
                // trim spaces and convert to lower case, both keywords and values.
                do {
                    String key = getKeyword();
                    if (key.length() == 0) {
                        break;
                    }
                    char c = next();
                    if (c != KEYWORD_ASSIGN) {
                        // throw new IllegalArgumentException("key '" + key + "' missing a value.");
                        if (c == DONE) {
                            break;
                        } else {
                            continue;
                        }
                    }
                    String value = getValue();
                    if (value.length() == 0) {
                        // throw new IllegalArgumentException("key '" + key + "' missing a value.");
                        continue;
                    }
                    if (m == null) {
                        m = new TreeMap<String, String>(getKeyComparator());
                    } else if (m.containsKey(key)) {
                        // throw new IllegalArgumentException("key '" + key + "' already has a value.");
                        continue;
                    }
                    m.put(key, value);
                } while (next() == ITEM_SEPARATOR);
            }
            keywords = m != null ? m : Collections.<String, String>emptyMap();
        }

        return keywords;
    }
944286
public static String replaceByMap(String _searchStr, Map<String, String> _replacements) {
        if (_searchStr == null) {
            return null;
        }
        if (_replacements == null || _replacements.isEmpty()) {
            return _searchStr;
        }

        String str = _searchStr;

        for (Entry<String, String> entry : _replacements.entrySet()) {
            str = str.replace(entry.getKey(), entry.getValue());
        }

        return str;
    }
120210
public Map<String, String> toMap() {
        Map<String, String> result = new LinkedHashMap<String, String>();
        for (int i = 0, size = size(); i < size; i++) {
            String name = name(i);
            String values = result.get(name);
            if (values == null) {
                values = value(i);
            } else {
                values += ", " + value(i);
            }
            result.put(name, values);
        }
        return result;
    }
169851
@MapMethod
    public List<String> keys(Map<String,Object> m){
        List<String> l = Objects.newArrayList();
        for(String k:m.keySet()){
            l.add(k);
        }
        return l;
    }
238063
public static String getMapContents(Map m) {
        StringBuffer sb = new StringBuffer(1000);
        Object[] sortedArray = m.keySet().toArray();
        Arrays.sort(sortedArray);

        for (Object element : sortedArray) {
            sb.append(element.toString() + " - " + m.get(element) + System.getProperty("line.separator"));
        }
        return sb.toString();
    }
236870
@JsonIgnore
    @SuppressWarnings("unchecked")
    public Map<String, Object> getDataMap() {
        if (data instanceof Map) {
            return (Map<String, Object>) data;
        }
        return Collections.emptyMap();
    }
807233
public static <K, V> ListMultimap<K, V> newLinkedHashListMultimap() {
		return Multimaps.newListMultimap(Maps.<K, Collection<V>> newLinkedHashMap(), new Supplier<List<V>>() {
			@Override
			public List<V> get() {
				return Lists.newArrayList();
			}
		});
	}
1285654
public synchronized Map<String, Object> getExtra() {
        if (extra == null || extra.isEmpty()) {
            return Collections.emptyMap();
        }

        return Collections.unmodifiableMap(extra);
    }
561303
public static Map<?, ?> getEmptyImplementationForMapInterface(final Class<?> mapInterface) {
        Map<?, ?> map = new HashMap<>();
        if (ConcurrentNavigableMap.class.isAssignableFrom(mapInterface)) {
            map = new ConcurrentSkipListMap<>();
        } else if (ConcurrentMap.class.isAssignableFrom(mapInterface)) {
            map = new ConcurrentHashMap<>();
        } else if (NavigableMap.class.isAssignableFrom(mapInterface)) {
            map = new TreeMap<>();
        } else if (SortedMap.class.isAssignableFrom(mapInterface)) {
            map = new TreeMap<>();
        }
        return map;
    }
183406
public Map<String, Object> asMap() {
        Map<String, Object> map = new LinkedHashMap<>();
        map.put("statusCode", statusCode);
        map.put("statusMessage", statusMessage);
        map.put("requestMethod", requestMethod);
        map.put("requestUri", requestUri);

        if (!StringUtils.isNullOrEmpty(message)) {
            map.put("message", message);
        }
        if (!StringUtils.isNullOrEmpty(stacktrace)) {
            map.put("stacktrace", stacktrace);
        }

        return map;
    }
44332
public Map<String, String> toStringMap() {
    Map<String, String> map = new HashMap<>();
    for (Map.Entry<String, Object> entry : entrySet()) {
      map.put(entry.getKey(), String.valueOf(entry.getValue()));
    }
    return map;
  }
276733
@Deprecated
  public static ImmutableMultimap<Symbol, Symbol> loadSymbolMultimap(File multimapFile)
      throws IOException {
    return loadSymbolMultimap(Files.asCharSource(multimapFile, Charsets.UTF_8));
  }
546132
@SuppressWarnings("unused")
        public Map<A, B> toMap() {
            Map<A, B> m = new HashMap<A, B>();
            m.put(_1, _2);
            return m;
        }