MZTabUtils { public static SplitList<Param> parseParamList(String target) { SplitList<String> list = parseStringList(BAR, target); Param param; SplitList<Param> paramList = new SplitList<Param>(BAR); for (String item : list) { param = parseParam(item); if (param == null) { paramList.clear(); return paramList; } else { paramList.add(param); } } return paramList; }  static boolean isEmpty(String s); static String parseString(String target); static String printDouble(Double value); static Param parseParam(String target); static SplitList<String> parseStringList(char splitChar, String target); static SplitList<Param> parseParamList(String target); static SplitList<String> parseGOTermList(String target); static Integer parseInteger(String target); static Double parseDouble(String target); static SplitList<Double> parseDoubleList(String target); static String parseUnitId(String target); static URL parseURL(String target); static URI parseURI(String target); static SplitList<PublicationItem> parsePublicationItems(String target); static SplitList<SpecRef> parseSpecRefList(Unit unit, String target); static Modification parseModification(Section section, String target); static SplitList<Modification> parseModificationList(Section section, String target);  }
@Test public void testParamList() throws Exception { SplitList<Param> paramList; StringBuilder sb = new StringBuilder(); paramList = parseParamList(sb.toString()); assertTrue(paramList.size() == 0); sb.append("[MS,MS:1001207,Mascot,]"); paramList = parseParamList(sb.toString()); assertTrue(paramList.size() == 1); assertTrue(paramList.get(0) instanceof CVParam); sb.append("|[, ,name,0.5]"); paramList = parseParamList(sb.toString()); assertTrue(paramList.size() == 2); assertTrue(paramList.get(1) instanceof UserParam); sb.append("|[MS,MS:1001171,Mascot:score,30]"); paramList = parseParamList(sb.toString()); assertTrue(paramList.size() == 3); assertTrue(paramList.get(2) instanceof CVParam); sb.append("|[, ,,0.5]"); paramList = parseParamList(sb.toString()); assertTrue(paramList.size() == 0); sb = new StringBuilder(); sb.append("null"); paramList = parseParamList(sb.toString()); assertTrue(paramList.size() == 0); }