Two java classes with different annotation values only
You can parameterize the @path annotation with regular expressions to specify one class/method that accepts multiple paths 

@Path("/{firstpath: first|second}/{param}") // will match /first/{param} and /second/{param}
public class First {

    @GET
    @Path("/{data}{p:/?}{difference:(\w*)}") // {p:/?} makes "/" optional, {difference:(\w*)} allows for optional text
    public Response doStuff(
            @Context HttpServletRequest request,
            @Context UriInfo uri,
            @Context HttpHeaders httpHeaders,
            @PathParam("param") String param,
            @PathParam("data") String data
    ) {

        // whatever
        return new Response();

    }

}