class SampleResource {

	@GET
	@Path("/{id}")
	@Produces("application/json")
	public Response get(@PathParam("id") String id) {
		Resource resource;
		try {
			resource = store.get(id);
		} catch (IOException e) {
			return Response.status(Response.Status.NOT_FOUND).build();
		}

		return Response.ok(resource).build();
	}

}

class SampleResourceTest {

	private HttpServer server;
	private Client client;

	@Test
	public void testGet() throws Exception {

		WebTarget target = client.target(Main.uri + "u1");

		Resource resource = target.request(MediaType.APPLICATION_JSON).get(Resource.class);
		assertEquals(1, resource.getContents().size());

		EObject u1 = resource.getContents().get(0);
		assertEquals("User", u1.eClass().getName());
		assertEquals("u1", u1.eGet(u1.eClass().getEStructuralFeature("name")));
	}

}