MulticostService { public String accept(final String input) { try { MulticostRequest req = decode(input); MulticostResponse rep = respond(req); return encode(rep); } catch (Exception e) { return ""; } } MulticostService(final List<RFC7285CostType> types, boolean testable); String accept(final String input);  }
@Test public void testMulticostCheck() throws Exception { MulticostRequest request = new MulticostRequest(); request.costType = c1; request.constraints = Arrays.asList("[0] le 100", "[1] le 6"); ObjectMapper mapper = new ObjectMapper(); String repr = mapper.writeValueAsString(request); MulticostService service = new MulticostService(clist, true); String rep = service.accept(repr); }