### Question:
IdUtil { public static String truncate(String id) { IdLexer lexer = new IdLexer(id); StringBuilder sb = new StringBuilder(); String r; String temp = ""; while ((r = lexer.nextToken()) != null) { if ("(".equals(r) || ")".equals(r) || ",".equals(r)) { sb.append(temp).append(r); temp = ""; } else if (!".".equals(r)) { temp = r; } } return sb.toString(); } private  IdUtil(); static String truncate(String id);  }### Answer:
@Test public void truncate() { assertEquals("(foo),(bar),(baz)", IdUtil.truncate(".(foo).,(bar).,(baz)")); }