Invoker { Map<String, Object> createParameters(WebRequest request, MatchResult match, Handler handler) throws Exception { Map<String, Object> parameters = new HashMap<>(); for (Map.Entry<String, Type> parameter : handler.getParameterNameToType().entrySet()) { String name = parameter.getKey(); Object value; if (Handler.NAME_ENTITY.equals(name)) { value = request.getEntity(); } else { value = match.getVariables().get(name); } parameters.put(name, convert(parameter.getValue(), value)); } return parameters; } @Inject  Invoker(GsonWebRenderer webRenderer, Logger logger); WebResponse invoke(WebRequest request, MatchResult match, Handler handler);  }
@Test public void createParametersWithEmptyString() throws Exception { Handler handler = createHandler("get"); Map<String, Object> parameters = invoker.createParameters(new WebRequest("GET", "/path", null), new MatchResult(true, ImmutableMap.of("a", "")), handler); assertEquals(null, parameters.get("a")); }