### Question:
TagParamUtils { public static List<String> spacesParameterToList(String spaces) throws XWikiException { if (spaces == null) { throw new IllegalArgumentException("Parameter 'spaces' should not be null"); } return new HQLInListParser(spaces).getResults(); } private  TagParamUtils(); static List<String> spacesParameterToList(String spaces);  }### Answer:
@Test public void spacesParameterToList() throws Exception { Assert.assertThat(TagParamUtils.spacesParameterToList("'Space1','Space2'"), Matchers.contains("Space1", "Space2")); Assert.assertThat(TagParamUtils.spacesParameterToList("'Space1', 'Space 2', 'Apo''strophe'"), Matchers.contains("Space1", "Space 2", "Apo'strophe")); Assert.assertThat(TagParamUtils.spacesParameterToList("'single space'"), Matchers.contains("single space")); Assert.assertThat(TagParamUtils.spacesParameterToList(""), Matchers.empty()); }
@Test public void spacesParameterToListExceptions() throws XWikiException { try { TagParamUtils.spacesParameterToList(null); Assert.fail("npe expected"); } catch (IllegalArgumentException expected) {} try { TagParamUtils.spacesParameterToList("'space1','space2"); Assert.fail("XWikiException expected"); } catch (XWikiException expected) {} try { TagParamUtils.spacesParameterToList("'space1','space2',"); Assert.fail("XWikiException expected"); } catch (XWikiException expected) {} try { TagParamUtils.spacesParameterToList("'space1', or 'space2'"); Assert.fail("XWikiException expected"); } catch (XWikiException expected) {} }