AbstractRequest implements Request { @Override public <T> void setValue(T value, String key, Class<? extends T> type) { parameters.put(key, value); parameterTypes.put(key, type); }  @Override Map<String, Object> getParameters(); @Override Map<String, Class<?>> getParameterTypes(); @Override Class<?> getType(String key); @Override T getValue(String key); @Override void setValue(T value, String key, Class<? extends T> type);  }
@Test public void setValue() throws Exception { request.setValue(VALUE, KEY, String.class); assertEquals(VALUE, request.getValue(KEY)); assertEquals(1, request.getParameters().size()); assertEquals(VALUE, request.getParameters().get(KEY)); assertEquals(String.class, request.getParameterTypes().get(KEY)); }