StringUtils { public static String toIdString(String name) { return name.replaceAll("[\\s_]", "-").toLowerCase(); } private  StringUtils(); static Pair pair(String left, String right); static String truncate(String s, int length, boolean addDots); static String trimToEmpty(String s); static String trimToNull(String s); static String repeat(char c, int count); static String join(Object[] a, char delimiter); static String join(Collection<String> c, char delimiter); static List<String> split(String s, char delimiter, boolean skipBackSlash); static boolean isBlank(String s); static String toIdString(String name); static StringUtils.Pair splitByFirstLineFeed(String text); static List<String> toStringLines(String text); static int countLineFeeds(String text); static int wrappedLinesEstimate(String text, int colWidth); static boolean isJavaScriptFunction(String text); static String fixJavaScriptFunction(String text);  }
@Test public void testToIdString() { assertEquals("foo-bar", StringUtils.toIdString("foo_bar")); thrown.expect(NullPointerException.class); StringUtils.toIdString(null); }