### Question:
UserController { @Transactional public void deleteUser(String username) { synchronized (userRepository) { userRepository.findById(username).ifPresent(u -> { userRepository.delete(u); userRepository.flush(); }); } } UserController(PasswordEncoder passwordEncoder, UserRepository userRepository); @Transactional void deleteUser(String username); List<User> getUsers(); @Transactional User updateUser(String username, String password, Set<UserRole> roles); @Transactional void syncUser(User jpaUser); String getPassword(String userName); User findUser(String name); @Transactional void removeRolesForContext(String context); @Transactional void deleteAll();  }### Answer:
@Test public void deleteUser() { testSubject.deleteUser("Demo"); assertTrue(users.isEmpty()); }