Buggy code:
@ Override public Classpage getClasspage ( String classpageCode , User user ) throws Exception { } @ Override public void deleteClasspage ( String classpageId , User user ) { } @ Override public SearchResults < Classpage > getClasspages ( Integer offset , Integer limit , User user , String title , String author , String userName ) { } @ Override public Classpage getClasspage ( String collectionId , User user , String merge ) { } @ Override public ActionResponseDTO < CollectionItem > createClasspageItem ( String assignmentGooruOid , String classpageGooruOid , CollectionItem collectionItem , User user , String type ) throws Exception { } @ Override public ActionResponseDTO < Classpage > createClasspage ( Classpage newclasspage , User user , boolean addToUserClasspage , String assignmentId ) throws Exception { } @ Override public List < Classpage > getMyClasspage ( Integer offset , Integer limit , User user , boolean skipPagination , String orderBy ) { } @ Override public Long getMyClasspageCount ( String gooruUid ) { } @ Override public ActionResponseDTO < Classpage > createClasspage ( Classpage classpage , String collectionId , boolean addToMy ) throws Exception { } @ Override public List < Map < String , Object > > classpageUserJoin ( String code , List < String > mailIds , User apiCaller ) throws Exception { } @ Override public void classpageUserRemove ( String code , List < String > mailIds , User apiCaller ) throws Exception { } @ Override public List < Map < String , Object > > getClassMemberList ( String code , String filterBy ) { } @ Override public Map < String , List < Map < String , Object > > > getClassMemberListByGroup ( String code , String filterBy ) { } private List < Map < String , Object > > getActiveMemberList ( String code ) { } private List < Map < String , Object > > getPendingMemberList ( String code ) { } private Map < String , Object > setInviteMember ( InviteUser inviteUser , String status ) { } private Map < String , Object > setMemberResponse ( UserGroupAssociation userGroupAssociation , String status ) { } @ Override public SearchResults < Map < String , Object > > getMemberList ( String code , Integer offset , Integer limit , String filterBy ) { } private Errors validateClasspage ( Classpage classpage ) throws Exception { } private Errors validateUpdateClasspage ( Collection collection , Collection newCollection ) throws Exception { } private Errors validateClasspageItem ( org . ednovo . gooru . core . api . model . Resource resource , CollectionItem collectionItem ) throws Exception { } @ Override public List < String > classMemberSuggest ( String queryText , String gooruUid ) { } @ Override public SearchResults < Map < String , Object > > getMyStudy ( User user , String orderBy , Integer offset , Integer limit , String type , String itemType ) { } @ Override public List < Map < String , Object > > setMyStudy ( List < Object [ ] > results , String itemType ) { } @ Override public CollectionItem updateAssignment ( String collectionItemId , String status , String minimumScore , String assignmentCompleted , String timeStudying , User user ) { } @ Override public List < Map < String , Object > > getClasspageItems ( String gooruOid , Integer limit , Integer offset , User apiCaller , String orderBy , boolean optimize , String status , String type ) { } public Map < String , Object > getClasspageAssoc ( Integer offset , Integer limit , String classpageId , String collectionId , String title , String collectionTitle , String classCode , String collectionCreator ) { } @ Override public Collection createPathway ( String classId , Collection pathway , String collectionId , Boolean isRequired ) throws Exception { } @ Override public Collection updatePathway ( String classId , String pathwayGooruOid , Collection newPathway ) throws Exception { } @ Override public void deletePathway ( String classId , String pathwayGooruOid , User user ) { final List < CollectionItem > collectionItems = this . getCollectionRepository ( ) . getCollectionItemByParentId ( pathwayGooruOid , null , null ) ; for ( CollectionItem item : collectionItems ) { <START_BUG> this . deleteCollectionItem ( item . getCollectionItemId ( ) , user , true ) ; <END_BUG> } this . getCollectionService ( ) . deleteCollection ( pathwayGooruOid , user ) ; getAsyncExecutor ( ) . deleteFromCache ( ( ( "v2-class-data-" + classId ) + "*" ) ) ; } @ Override public List < CollectionItem > getPathwayItems ( String classId , String pathwayId , Integer offset , Integer limit , String orderBy , User user ) { } private List < CollectionItem > getPathawyItemWithOutValidation ( String pathwayId , Integer offset , Integer limit , String orderBy , User user ) { } @ Override public SearchResults < CollectionItem > getPathwayItemsSearchResults ( String classId , String pathwayId , Integer offset , Integer limit , String orderBy , User user ) { } @ Override public ActionResponseDTO < CollectionItem > reorderPathwaySequence ( String classId , String pathwayId , int newSequence ) throws Exception { } @ Override public CollectionItem pathwayItemMoveWithReorder ( String classId , String pathwayId , String sourceId , String taregetId , Integer newSequence , User user ) throws Exception { } public ActionResponseDTO < CollectionItem > moveCollectionToPathway ( CollectionItem sourceIdItem , CollectionItem pathwayItem , ActionResponseDTO < CollectionItem > responseDTO , User user ) throws Exception { } @ Override public void deletePathwayItem ( String classId , String pathwayGooruOid , String collectionItemId , User user ) { } @ Override public ActionResponseDTO < CollectionItem > updatePathwayItem ( String classId , String pathwayGooruOid , String collectionItemId , CollectionItem newcollectionItem , User user ) throws Exception { } @ Override public Map < String , Object > getParentDetails ( String collectionItemId ) { } public CollectionEventLog getScollectionEventlog ( ) { } public TaskService getTaskService ( ) { }

Fix:
this . deleteCollectionItem ( item . getCollectionItemId ( ) , user , false ) ;