Seems like it'd be worth it to write a test for this using JerseyTest or ResourceTest.