@Test public void extractNameList() { assertEquals(Arrays.asList(new String[] { "a" }), TeeFilter.extractNameList("a")); assertEquals(Arrays.asList(new String[] { "a", "b" }), TeeFilter.extractNameList("a, b")); assertEquals(Arrays.asList(new String[] { "a", "b" }), TeeFilter.extractNameList("a; b")); assertEquals(Arrays.asList(new String[] { "a", "b", "c" }), TeeFilter.extractNameList("a; b, c")); }
static List<String> extractNameList(String nameListAsStr) { List<String> nameList = new ArrayList<String>(); if (nameListAsStr == null) { return nameList; } nameListAsStr = nameListAsStr.trim(); if (nameListAsStr.length() == 0) { return nameList; } String[] nameArray = nameListAsStr.split("[,;]"); for (String n : nameArray) { n = n.trim(); nameList.add(n); } return nameList; }
TeeFilter implements Filter { static List<String> extractNameList(String nameListAsStr) { List<String> nameList = new ArrayList<String>(); if (nameListAsStr == null) { return nameList; } nameListAsStr = nameListAsStr.trim(); if (nameListAsStr.length() == 0) { return nameList; } String[] nameArray = nameListAsStr.split("[,;]"); for (String n : nameArray) { n = n.trim(); nameList.add(n); } return nameList; } }
TeeFilter implements Filter { static List<String> extractNameList(String nameListAsStr) { List<String> nameList = new ArrayList<String>(); if (nameListAsStr == null) { return nameList; } nameListAsStr = nameListAsStr.trim(); if (nameListAsStr.length() == 0) { return nameList; } String[] nameArray = nameListAsStr.split("[,;]"); for (String n : nameArray) { n = n.trim(); nameList.add(n); } return nameList; }  }
TeeFilter implements Filter { static List<String> extractNameList(String nameListAsStr) { List<String> nameList = new ArrayList<String>(); if (nameListAsStr == null) { return nameList; } nameListAsStr = nameListAsStr.trim(); if (nameListAsStr.length() == 0) { return nameList; } String[] nameArray = nameListAsStr.split("[,;]"); for (String n : nameArray) { n = n.trim(); nameList.add(n); } return nameList; }  @Override void destroy(); @Override void doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain); @Override void init(FilterConfig filterConfig); }
TeeFilter implements Filter { static List<String> extractNameList(String nameListAsStr) { List<String> nameList = new ArrayList<String>(); if (nameListAsStr == null) { return nameList; } nameListAsStr = nameListAsStr.trim(); if (nameListAsStr.length() == 0) { return nameList; } String[] nameArray = nameListAsStr.split("[,;]"); for (String n : nameArray) { n = n.trim(); nameList.add(n); } return nameList; }  @Override void destroy(); @Override void doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain); @Override void init(FilterConfig filterConfig);  }