### Question:
CreateComplexMeasurement { public ActionPossibility canCreate(ApplicationUser user) { boolean possible = user != null && user.getName() != null && !user.getName().isEmpty(); return new ActionPossibility(possible, "Anonymous user cannot create complex measurement", HttpStatus.UNAUTHORIZED); }  Measurement create(ComplexMeasurement measurement, ApplicationUser user); ActionPossibility canCreate(ApplicationUser user); ActionPossibility baseMeasurementExists(ComplexMeasurement complexMeasurement);  }### Answer:
@Test public void testCanCreate() { user = new ApplicationUser(""); Assert.assertFalse(uut.canCreate(user).isPossible()); user.setName("TestUser"); Assert.assertTrue(uut.canCreate(user).isPossible()); }