Utils { public static String dataAsString(double[] data) { return Arrays.toString(data); } private  Utils(); static String dataAsString(double[] data); static String quote(String string); static String dataAsString(Object[] data); static String dataAsString(double[][] data);  }
@Test public void testEscapeQuote() { String s = Utils.dataAsString(new String[] {"Bobby\"s tables"}); assertTrue(s.contains("\\"), s); String s2 = Utils.dataAsString(new String[] {"Hello\\"}); assertEquals("[\"Hello\\\\\"]", s2); }