StringUtils { static String componentsSeparatedByWithEscapes(@NonNull List list, String splitBy) { return componentsSeparatedBy(list, splitBy, true); }    }
@Test public void componentsSeparatedByWithEscapes() throws Exception { List<String> stuff = new ArrayList<>(); stuff.add("foo,foo"); stuff.add("bar:bar"); stuff.add("baz&baz"); String output = StringUtils.componentsSeparatedByWithEscapes(stuff, ","); assertEquals("foo\\,foo,bar\\:bar,baz%26baz", output); }