### Question:
LessonResource { @DELETE @Path("{lessonId}") public Response delete(@PathParam("lessonId") Long lessonId) { Lesson lesson = Lesson.findById(lessonId); if (lesson == null) { return Response.status(Response.Status.NOT_FOUND).build(); } lesson.delete(); return Response.status(Response.Status.OK).build(); }  @GET List<Lesson> getAllLessons(); @POST Response add(Lesson lesson); @DELETE @Path("{lessonId}") Response delete(@PathParam("lessonId") Long lessonId);  }### Answer:
@Test void addAndRemove() { Lesson lesson = given() .when() .contentType(ContentType.JSON) .body(new Lesson("Test subject", "Test teacher", "test studentGroup")) .post("/lessons") .then() .statusCode(202) .extract().as(Lesson.class); given() .when() .delete("/lessons/{id}", lesson.getId()) .then() .statusCode(200); }