package com.dmnlk.sample;

import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

/**
 * @author dmnlk
 */
@Path("/hello")
@Produces(MediaType.APPLICATION_JSON)
public class SampleResource {
}

@@ -31,198 +31,934 @@
 ort 
-javax.ws.rs.Path;%0Aimport javax.ws.rs.Produces;%0Aimport javax.ws.rs.core.MediaType;%0A%0A/**%0A * @author dmnlk%0A */%0A@Path(%22/hello%22)%0A@Produces(MediaType.APPLICATION_JSON)%0Apublic class SampleResource %7B
+com.codahale.metrics.annotation.Timed;%0Aimport com.google.common.base.Optional;%0A%0Aimport javax.ws.rs.GET;%0Aimport javax.ws.rs.Path;%0Aimport javax.ws.rs.Produces;%0Aimport javax.ws.rs.QueryParam;%0Aimport javax.ws.rs.core.MediaType;%0A%0Aimport java.util.concurrent.atomic.AtomicLong;%0A%0A/**%0A * @author dmnlk%0A */%0A@Path(%22/hello%22)%0A@Produces(MediaType.APPLICATION_JSON)%0Apublic class SampleResource %7B%0A    private final String template;%0A    private final String defaultName;%0A    private final AtomicLong counter;%0A%0A    public SampleResource(String template, String defaultName, AtomicLong counter) %7B%0A        this.template = template;%0A        this.defaultName = defaultName;%0A        this.counter = counter;%0A    %7D%0A%0A    @GET%0A    @Timed%0A    public Saying sayHello(@QueryParam(%22name%22)Optional%3CString%3E name) %7B%0A        final String value = String.format(template, name.or(defaultName));%0A        return  new Saying(counter.incrementAndGet(), value);%0A    %7D%0A
 %0A%7D%0A

implement sample