### Question:
DeleteComplexMeasurement { public ActionPossibility canDelete(UUID uuid, ApplicationUser user) { InternalErrorException.check(measurementExists(uuid)); if(user == null) { return ActionPossibility.forFalse("Only logged users can delete measurements", HttpStatus.UNAUTHORIZED); } boolean possible = complexMeasurementService.getDetails(uuid).getCreatedBy().equals(user); String reason = String.format("User [%s] didn't create measurement [%s]", user, uuid); return new ActionPossibility(possible, reason, HttpStatus.FORBIDDEN); }  void delete(UUID uuid, ApplicationUser user); ActionPossibility canDelete(UUID uuid, ApplicationUser user); ActionPossibility measurementExists(UUID uuid);  }### Answer:
@Test public void testCanDelete() { ApplicationUser newUser = new ApplicationUser(""); ActionPossibility ap = uut.canDelete(complexMeasurement.getId(), newUser); Assert.assertFalse(ap.getReason(), ap.isPossible()); user.setName("TestUser"); ap = uut.canDelete(complexMeasurement.getId(), user); Assert.assertTrue(ap.getReason(), ap.isPossible()); }