@Test public void onlyParamsWithWhitespaces() { List<String> splitParams = ParameterUtils.splitParams(QUOTED_PARAM_WITH_WHITESPACE.concat(" ").concat(QUOTED_PARAM_WITH_WHITESPACE).concat(QUOTED_PARAM_WITH_WHITESPACE)); Assert.assertArrayEquals(new String[] {PARAM_WITH_WHITESPACE, PARAM_WITH_WHITESPACE, PARAM_WITH_WHITESPACE}, splitParams.toArray(new String[0])); }
public static List<String> splitParams(String parameterString) { ArrayList<String> params = new ArrayList<>(); Matcher m = WHITESPACE_IF_NOT_QUOTED.matcher(parameterString); while (m.find()) { if (m.group(1) != null) { params.add(m.group(1)); } else { params.add(m.group(2)); } } return params; }
ParameterUtils { public static List<String> splitParams(String parameterString) { ArrayList<String> params = new ArrayList<>(); Matcher m = WHITESPACE_IF_NOT_QUOTED.matcher(parameterString); while (m.find()) { if (m.group(1) != null) { params.add(m.group(1)); } else { params.add(m.group(2)); } } return params; } }
ParameterUtils { public static List<String> splitParams(String parameterString) { ArrayList<String> params = new ArrayList<>(); Matcher m = WHITESPACE_IF_NOT_QUOTED.matcher(parameterString); while (m.find()) { if (m.group(1) != null) { params.add(m.group(1)); } else { params.add(m.group(2)); } } return params; } private  ParameterUtils(); }
ParameterUtils { public static List<String> splitParams(String parameterString) { ArrayList<String> params = new ArrayList<>(); Matcher m = WHITESPACE_IF_NOT_QUOTED.matcher(parameterString); while (m.find()) { if (m.group(1) != null) { params.add(m.group(1)); } else { params.add(m.group(2)); } } return params; } private  ParameterUtils(); static List<String> splitParams(String parameterString); }
ParameterUtils { public static List<String> splitParams(String parameterString) { ArrayList<String> params = new ArrayList<>(); Matcher m = WHITESPACE_IF_NOT_QUOTED.matcher(parameterString); while (m.find()) { if (m.group(1) != null) { params.add(m.group(1)); } else { params.add(m.group(2)); } } return params; } private  ParameterUtils(); static List<String> splitParams(String parameterString);  }