GuidedDTDRLPersistence { String makeInList(final String cell) { if (cell.startsWith("(")) { return cell; } String result = ""; Iterator<String> iterator = Arrays.asList(ListSplitter.split("\"", true, cell)).iterator(); while (iterator.hasNext()) { final String item = iterator.next(); if (item.startsWith("\"")) { result += item; } else { result += "\"" + item + "\""; } if (iterator.hasNext()) { result += ", "; } } return "(" + result + ")"; }  static GuidedDTDRLPersistence getInstance(); String marshal(final GuidedDecisionTable52 originalDTable);  }
@Test public void testCellCSV() { GuidedDTDRLPersistence p = new GuidedDTDRLPersistence(); assertEquals("(\"Helsinki, Finland\", \"Boston\")", p.makeInList("\"Helsinki, Finland\",Boston")); assertEquals("(\"Michael\", \"Mark\", \"Peter\")", p.makeInList("Michael, Mark, Peter")); assertEquals("(\"Michael\")", p.makeInList("Michael")); assertEquals("(\"Michael\")", p.makeInList("\"Michael\"")); assertEquals("(\"Michael\", \"Ma rk\", \"Peter\")", p.makeInList("Michael, \"Ma rk\", Peter")); assertEquals("(WEE WAAH)", p.makeInList("(WEE WAAH)")); }