### Question:
CommonResource extends ServerResource { public List<String> getParameterAsList(final String name) { return Arrays.asList(getQuery().getValuesArray(name)); }  APISession getEngineSession(); HttpSession getHttpSession(); HttpServletRequest getHttpRequest(); Integer getIntegerParameter(final String parameterName, final boolean mandatory); Long getLongParameter(final String parameterName, final boolean mandatory); String getParameter(final String parameterName, final boolean mandatory); List<String> getParameterAsList(final String name); SearchOptions buildSearchOptions(); @Override String getAttribute(final String name); Long getPathParamAsLong(final String parameterName); List<Long> getParameterAsLongList(final String parameterName); String getPathParam(final String name);  }### Answer:
@Test public void getParametersAsList_should_support_value_with_comma() throws Exception { final CommonResource resource = spy(new CommonResource()); final Form form = new Form("f=a=b&f=c=d,e"); given(resource.getQuery()).willReturn(form); final List<String> parametersValues = resource.getParameterAsList("f"); assertThat(parametersValues).containsExactly("a=b", "c=d,e"); }
@Test public void getParametersAsList_should_support_values_with_slash() throws Exception { final CommonResource resource = spy(new CommonResource()); final Form form = new Form("f=a%3Db&f=c%3D%2Fd%2Fd%2Ce"); given(resource.getQuery()).willReturn(form); final List<String> parametersValues = resource.getParameterAsList("f"); assertThat(parametersValues).containsExactly("a=b", "c=/d/d,e"); }
@Test public void getParametersAsList_should_return_emptyList_when_parameter_does_not_exist() throws Exception { final CommonResource resource = spy(new CommonResource()); final Form form = new Form("f=a=b&f=c=d,e"); given(resource.getQuery()).willReturn(form); final List<String> parametersValues = resource.getParameterAsList("anyAbsent"); assertThat(parametersValues).isEmpty(); }