OrganizationManager { @Transactional(rollbackOn = {RuntimeException.class, ApiException.class}) public void remove(String organizationId) throws ServerException { requireNonNull(organizationId, "Required non-null organization id"); try { OrganizationImpl organization = organizationDao.getById(organizationId); eventService .publish(new BeforeAccountRemovedEvent(organization.getAccount())) .propagateException(); eventService.publish(new BeforeOrganizationRemovedEvent(organization)).propagateException(); removeSuborganizations(organizationId); final List<String> members = removeMembers(organizationId); organizationDao.remove(organizationId); final String initiator = EnvironmentContext.getCurrent().getSubject().getUserName(); eventService.publish(asDto(new OrganizationRemovedEvent(initiator, organization, members))); } catch (NotFoundException e) { } } @Inject  OrganizationManager(
      EventService eventService,
      OrganizationDao organizationDao,
      MemberDao memberDao,
      @Named("che.auth.reserved_user_names") String[] reservedNames); @Transactional(rollbackOn = {RuntimeException.class, ApiException.class}) Organization create(Organization newOrganization); @Transactional(rollbackOn = {RuntimeException.class, ApiException.class}) Organization update(String organizationId, Organization update); @Transactional(rollbackOn = {RuntimeException.class, ApiException.class}) void remove(String organizationId); Organization getById(String organizationId); Organization getByName(String organizationName); Page<? extends Organization> getByParent(String parent, int maxItems, long skipCount); Page<OrganizationImpl> getSuborganizations(
      String parentQualifiedName, int maxItems, long skipCount); Page<? extends Organization> getByMember(String userId, int maxItems, int skipCount); Page<? extends Member> getMembers(String organizationId, int maxItems, long skipCount);  }
@Test(expectedExceptions = NullPointerException.class) public void shouldThrowNpeWhenRemovingOrganizationByNullId() throws Exception { manager.remove(null); }