InviteManager { public void remove(String domainId, String instanceId, String email) throws ServerException { requireNonNull(domainId, "Required non-null domain id"); requireNonNull(instanceId, "Required non-null instance id"); requireNonNull(email, "Required non-null email"); inviteDao.remove(domainId, instanceId, email); } @Inject  InviteManager(
      PermissionsManager permissionsManager,
      UserManager userManager,
      InviteDao inviteDao,
      EventService eventService); @Transactional(rollbackOn = {RuntimeException.class, ServerException.class}) void store(Invite invite); Invite getInvite(String domainId, String instanceId, String email); Page<? extends Invite> getInvites(String email, int maxItems, long skipCount); Page<? extends Invite> getInvites(
      String domainId, String instanceId, long skipCount, int maxItems); void remove(String domainId, String instanceId, String email);  }
@Test public void shouldRemoveInvite() throws Exception { inviteManager.remove("test", "test123", "user@test.com"); verify(inviteDao).remove("test", "test123", "user@test.com"); }
@Test( expectedExceptions = NullPointerException.class, expectedExceptionsMessageRegExp = "Required non-null domain id" ) public void shouldThrowOnRemovingInviteByNullDomain() throws Exception { inviteManager.remove(null, "test123", "user@test.com"); }
@Test( expectedExceptions = NullPointerException.class, expectedExceptionsMessageRegExp = "Required non-null instance id" ) public void shouldThrowOnRemovingInviteByNullInstance() throws Exception { inviteManager.remove("test", null, "user@test.com"); }
@Test( expectedExceptions = NullPointerException.class, expectedExceptionsMessageRegExp = "Required non-null email" ) public void shouldThrowOnRemovingInviteByNullEmail() throws Exception { inviteManager.remove("test", "test123", null); }