@Override
    public String convert(IAccessEvent accessEvent) {
        if (!isStarted()) {
            return "INACTIVE_REQUEST_PARAM_CONV";
        }

        // This call should be safe, because the request map is cached beforehand
        final String[] paramArray = accessEvent.getRequestParameterMap().get(key);
        if (paramArray == null || paramArray.length == 0) {
            return "-";
        } else if (paramArray.length == 1) {
            return paramArray[0];
        } else {
            return Arrays.toString(paramArray);
        }
    }
@Test
    void testConvertOneParameter() throws Exception {
        Mockito.when(httpServletRequest.getParameterValues("name")).thenReturn(new String[]{"Alice"});
        Mockito.when(httpServletRequest.getParameterNames())
                .thenReturn(Collections.enumeration(Collections.singleton("name")));

        // Invoked by AccessEvent#prepareForDeferredProcessing
        accessEvent.buildRequestParameterMap();
        // Jetty recycled the request
        Mockito.reset(httpServletRequest);

        String value = safeRequestParameterConverter.convert(accessEvent);
        assertThat(value).isEqualTo("Alice");
    }