Buggy code:
@ Service public class CollaboratorServiceImpl extends BaseServiceImpl implements ConstantProperties , ParameterProperties , CollaboratorService { @ Autowired private UserRepository userRepository ; @ Autowired private CollaboratorEventLog collaboratorEventLog ; @ Autowired private CollectionRepository collectionRepository ; @ Autowired private CustomTableRepository customTableRepository ; @ Autowired private CollectionService collectionService ; @ Autowired private CollaboratorRepository collaboratorRepository ; @ Autowired private UserManagementService userManagementService ; @ Autowired private ContentService contentService ; @ Autowired private MailAsyncExecutor mailAsyncExecutor ; @ Autowired private InviteRepository inviteRepository ; @ Autowired private AsyncExecutor asyncExecutor ; private final Logger LOGGER = LoggerFactory . getLogger ( CollaboratorServiceImpl . class ) ; @ Override public List < Map < String , Object > > addCollaborator ( List < String > email , String gooruOid , User apiCaller , boolean sendInvite ) throws Exception { } private Map < String , Object > addCollaborator ( String mailId , String gooruOid , User apiCaller , boolean sendInvite , Content content , User user ) throws Exception { } private Map < String , Object > setInviteCollaborator ( InviteUser inviteUser , String status ) { } private Map < String , Object > setActiveCollaborator ( final UserContentAssoc userContentAssoc , String status ) { } @ Override public List < String > collaboratorSuggest ( String text , String gooruUid ) { } @ Override public void deleteCollaborator ( String gooruOid , List < String > email ) { Content content = null ; if ( gooruOid != null ) { content = getContentRepository ( ) . findContentByGooruId ( gooruOid , true ) ; if ( content == null ) { throw new org . ednovo . gooru . core . exception . NotFoundException ( generateErrorMessage ( "GL0056" , "content" ) ) ; } } else { throw new org . ednovo . gooru . core . exception . BadRequestException ( generateErrorMessage ( "GL0088" ) ) ; } if ( email != null ) { for ( String mailId : email ) { Identity identity = this . getUserRepository ( ) . findByEmailIdOrUserName ( mailId , true , false ) ; if ( identity != null ) { UserContentAssoc userContentAssoc = this . getCollaboratorRepository ( ) . findCollaboratorById ( gooruOid , identity . getUser ( ) . getGooruUId ( ) ) ; List < CollectionItem > collectionItems = this . getCollectionRepository ( ) . findCollectionByResource ( gooruOid , identity . getUser ( ) . getGooruUId ( ) , COLLABORATOR ) ; if ( userContentAssoc != null ) { this . getCollaboratorRepository ( ) . remove ( userContentAssoc ) ; if ( collectionItems != null ) { this . getCollectionRepository ( ) . removeAll ( collectionItems ) ; } this . getContentService ( ) . deleteContentPermission ( content , identity . getUser ( ) ) ; final List < CollectionItem > associations = this . getCollectionRepository ( ) . getCollectionItemByAssociation ( gooruOid , identity . getUser ( ) . getGooruUId ( ) , null ) ; try { this . getCollaboratorEventLog ( ) . getEventLogs ( identity . getUser ( ) , ( ( associations . size ( ) ) > 0 ? associations . get ( 0 ) : null ) , gooruOid , false , true ) ; } catch ( JSONException e ) { e . printStackTrace ( ) ; } for ( CollectionItem association : associations ) { <START_BUG> this . getCollectionService ( ) . deleteCollectionItem ( association . getCollectionItemId ( ) , identity . getUser ( ) ) ; <END_BUG> } } getAsyncExecutor ( ) . deleteFromCache ( ( ( ( V2_ORGANIZE_DATA ) + ( identity . getUser ( ) . getPartyUid ( ) ) ) + "*" ) ) ; getAsyncExecutor ( ) . deleteFromCache ( ( ( ( V2_ORGANIZE_DATA ) + ( content . getUser ( ) . getPartyUid ( ) ) ) + "*" ) ) ; } else { InviteUser inviteUser = this . getInviteRepository ( ) . findInviteUserById ( mailId , gooruOid , PENDING ) ; if ( inviteUser != null ) { this . getCollaboratorRepository ( ) . remove ( inviteUser ) ; } } } try { indexProcessor . index ( content . getGooruOid ( ) , INDEX , SCOLLECTION ) ; } catch ( Exception e ) { LOGGER . debug ( e . getMessage ( ) ) ; } } } @ Override public List < Map < String , Object > > getCollaborators ( String gooruOid , String filterBy ) { } @ Override public Map < String , List < Map < String , Object > > > getCollaboratorsByGroup ( String gooruOid , String filterBy ) { } @ Override public List < Map < String , Object > > getActiveCollaborator ( String gooruOid ) { } @ Override public List < Map < String , Object > > getPendingCollaborator ( String gooruOid ) { } @ Override public void updateCollaboratorStatus ( String mailId , User user ) throws Exception { } public UserRepository getUserRepository ( ) { } public CollectionRepository getCollectionRepository ( ) { } public CustomTableRepository getCustomTableRepository ( ) { } public CollectionService getCollectionService ( ) { } public CollaboratorRepository getCollaboratorRepository ( ) { } public ContentService getContentService ( ) { } public MailAsyncExecutor getMailAsyncExecutor ( ) { } public UserManagementService getUserManagementService ( ) { } public InviteRepository getInviteRepository ( ) { } public CollaboratorEventLog getCollaboratorEventLog ( ) { } public AsyncExecutor getAsyncExecutor ( ) { } }

Fix:
this . getCollectionService ( ) . deleteCollectionItem ( association . getCollectionItemId ( ) , identity . getUser ( ) , true ) ;