### Question:
HandlerRequestUtils { public static <X, P extends MessageQueryParameter<X>, R extends RequestBody, M extends MessageParameters> X getQueryParameter( final HandlerRequest<R, M> request, final Class<P> queryParameterClass) throws RestHandlerException { return getQueryParameter(request, queryParameterClass, null); }  static X getQueryParameter(
			final HandlerRequest<R, M> request,
			final Class<P> queryParameterClass); static X getQueryParameter(
			final HandlerRequest<R, M> request,
			final Class<P> queryParameterClass,
			final X defaultValue);  }### Answer:
@Test public void testGetQueryParameter() throws Exception { final Boolean queryParameter = HandlerRequestUtils.getQueryParameter( new HandlerRequest<>( EmptyRequestBody.getInstance(), new TestMessageParameters(), Collections.emptyMap(), Collections.singletonMap("key", Collections.singletonList("true"))), TestBooleanQueryParameter.class); assertThat(queryParameter, equalTo(true)); }
@Test public void testGetQueryParameterRepeated() throws Exception { try { HandlerRequestUtils.getQueryParameter( new HandlerRequest<>( EmptyRequestBody.getInstance(), new TestMessageParameters(), Collections.emptyMap(), Collections.singletonMap("key", Arrays.asList("true", "false"))), TestBooleanQueryParameter.class); } catch (final RestHandlerException e) { assertThat(e.getMessage(), containsString("Expected only one value")); } }
@Test public void testGetQueryParameterDefaultValue() throws Exception { final Boolean allowNonRestoredState = HandlerRequestUtils.getQueryParameter( new HandlerRequest<>( EmptyRequestBody.getInstance(), new TestMessageParameters(), Collections.emptyMap(), Collections.singletonMap("key", Collections.emptyList())), TestBooleanQueryParameter.class, true); assertThat(allowNonRestoredState, equalTo(true)); }