According to the JAX-RS specification (page 17), section 3.7.3 Converting URI Templates to Regular Expressions:
4. If the resulting string ends with '/' then remove the final character.
Therefore, @Path(value = "/")
and @Path(value = "")
will hit the same method, because the trailing /
on the first @Path
will be removed.
Accordingly, the requests http://localhost:8080/test
and http://localhost:8080/test/
do not differ to one another.