@Test public void testFormatEmptyList() { assertEquals("formatEmptyList", "[]", ListFormat.format(new ArrayList<String>())); }
public static String format(Object[] data) { StringBuilder sb = new StringBuilder().append('['); for (Object d : data) { if (sb.length() > 1) sb.append(", "); if (d instanceof String) sb.append('"').append(d).append('"'); else sb.append(d); } sb.append("]"); return sb.toString(); }
ListFormat { public static String format(Object[] data) { StringBuilder sb = new StringBuilder().append('['); for (Object d : data) { if (sb.length() > 1) sb.append(", "); if (d instanceof String) sb.append('"').append(d).append('"'); else sb.append(d); } sb.append("]"); return sb.toString(); } }
ListFormat { public static String format(Object[] data) { StringBuilder sb = new StringBuilder().append('['); for (Object d : data) { if (sb.length() > 1) sb.append(", "); if (d instanceof String) sb.append('"').append(d).append('"'); else sb.append(d); } sb.append("]"); return sb.toString(); }  }
ListFormat { public static String format(Object[] data) { StringBuilder sb = new StringBuilder().append('['); for (Object d : data) { if (sb.length() > 1) sb.append(", "); if (d instanceof String) sb.append('"').append(d).append('"'); else sb.append(d); } sb.append("]"); return sb.toString(); }  static String format(Object[] data); static String format(List<?> data); static List<String> parse(String input); }
ListFormat { public static String format(Object[] data) { StringBuilder sb = new StringBuilder().append('['); for (Object d : data) { if (sb.length() > 1) sb.append(", "); if (d instanceof String) sb.append('"').append(d).append('"'); else sb.append(d); } sb.append("]"); return sb.toString(); }  static String format(Object[] data); static String format(List<?> data); static List<String> parse(String input);  }