class MessagesController {

    private final RuntimeEnvironment env = RuntimeEnvironment.getInstance();

    @POST
    @Consumes(MediaType.APPLICATION_JSON)
    public Response addMessage(@Valid final Message message) {
        env.addMessage(message);

        return Response.status(Response.Status.CREATED).build();
    }

    @DELETE
    @Consumes(MediaType.TEXT_PLAIN)
    public void removeMessagesWithTag(@QueryParam("tag") final String tag, final String text) {<FILL_FUNCTION_BODY>}

    @GET
    @Produces(MediaType.APPLICATION_JSON)
    public Set<AcceptedMessage> getMessages(@QueryParam("tag") final String tag) {
        if (tag != null) {
            return env.getMessages(tag);
        } else {
            return env.getAllMessages();
        }
    }

}

        if (tag == null) {
            throw new WebApplicationException("Message tag has to be specified", Response.Status.BAD_REQUEST);
        }
        env.removeAnyMessage(Collections.singleton(tag), text);
    
<no_super_class>