public static <
                    X,
                    P extends MessageQueryParameter<X>,
                    R extends RequestBody,
                    M extends MessageParameters>
            X getQueryParameter(final HandlerRequest<R> request, final Class<P> queryParameterClass)
                    throws RestHandlerException {

        return getQueryParameter(request, queryParameterClass, null);
    }
@Test
    void testGetQueryParameterRepeated() throws Exception {
        try {
            HandlerRequestUtils.getQueryParameter(
                    HandlerRequest.resolveParametersAndCreate(
                            EmptyRequestBody.getInstance(),
                            new TestMessageParameters(),
                            Collections.emptyMap(),
                            Collections.singletonMap("key", Arrays.asList("true", "false")),
                            Collections.emptyList()),
                    TestBooleanQueryParameter.class);
        } catch (final RestHandlerException e) {
            assertThat(e.getMessage()).contains("Expected only one value");
        }
    }