Util { public static Map<String, String> parseParameters(String params) { Map<String, String> result = Maps.newHashMap(); params = StringUtils.defaultString(params); String[] parts = StringUtils.splitByWholeSeparator(params, null); for (String part : parts) { String[] keyValue = StringUtils.split(part, "=", 2); String key = keyValue[0]; String value = keyValue.length > 1 ? keyValue[1] : StringUtils.EMPTY; result.put(key, value); } return result; } private  Util(); static String toRealPagePath(String pagePath); static String toUrlPagePath(String pagePath); static String simplifyForUrl(String text); static String join(Object o, String delimiter); static void deleteQuietly(File f); static RuntimeException toRuntimeException(Throwable t); static File toFile(File baseDir, String path); static void closeQuietly(Closeable c); static Map<String, String> parseParameters(String params); static String serialize(Serializable s); static T deserialize(String s, Class<T> clazz);  }
@Test public void parseParameters() { Map<String, String> params = Util.parseParameters("foo bar=baz"); assertTrue(StringUtils.isEmpty(params.get("foo"))); assertEquals("baz", params.get("bar")); }