Buggy code:
@ Service public class CollectionServiceImpl extends ScollectionServiceImpl implements CollectionService { @ Autowired private CollectionRepository collectionRepository ; @ Autowired private MailHandler mailHandler ; @ Autowired private CollectionEventLog collectionEventLog ; @ Autowired private TaxonomyRespository taxonomyRespository ; @ Autowired private StorageRepository storageRepository ; @ Autowired private UserService userService ; @ Autowired private RedisService redisService ; @ Autowired private CollaboratorRepository collaboratorRepository ; @ Autowired private PartyService partyService ; @ Autowired private IndexHandler indexHandler ; @ Autowired private MongoQuestionsService mongoQuestionsService ; final int zero = 0 ; private static final Logger LOGGER = LoggerFactory . getLogger ( CollectionServiceImpl . class ) ; @ Override public ActionResponseDTO < CollectionItem > createQuestionWithCollectionItem ( final String collectionId , final String data , final User user , final String mediaFileName , final String sourceReference ) throws Exception { } private ActionResponseDTO < CollectionItem > updateQuestionWithCollectionItem ( final CollectionItem collectionItem , final String data , final List < Integer > deleteAssets , final User user , final String mediaFileName ) throws Exception { } @ Override public ActionResponseDTO < CollectionItem > updateQuestionWithCollectionItem ( final String collectionItemId , final String data , final List < Integer > deleteAssets , final User user , final String mediaFileName ) throws Exception { } @ Override public ActionResponseDTO < CollectionItem > updateQuestionWithCollectionItem ( final String collectionId , final String resourceId , final String data , final List < Integer > deleteAssets , final User user , final String mediaFileName ) throws Exception { } @ Override public void deleteQuestionWithCollectionItem ( final String collectionId , final String resourceId ) { } @ Override public ActionResponseDTO < CollectionItem > moveCollectionToFolder ( final String sourceId , final String targetId , final User user ) throws Exception { } @ Override public ActionResponseDTO < CollectionItem > createQuestionWithCollectionItem ( final String collectionId , final AssessmentQuestion assessmentQuestion , final User user , final String mediaFileName ) throws Exception { } @ Override public List < CollectionItem > createCollectionItems ( final List < String > collectionsIds , final String resourceId , final User user ) throws Exception { } @ Override public List < Map < String , Object > > getMyShelf ( String gooruUid , Integer limit , Integer offset , final String sharing , final String collectionType , Integer itemLimit , boolean fetchChildItem , final String topLevelCollectionType , final String orderBy , String excludeType ) { } public List < Map < String , Object > > getCollectionItem ( final String gooruOid , final String sharing , final String collectionType , Integer itemLimit , final boolean fetchChildItem , final String orderBy , final String excludeType ) { } private Map < String , Object > setFolderItem ( final Map < String , Object > folderItem , String sharing , String collectionType , Integer itemLimit , boolean fetchChildItem , String orderBy , String excludeType ) { <START_BUG> final String typeName = String . valueOf ( folderItem . get ( COLLECTION_TYPE ) ) ; <END_BUG> final String collectionGooruOid = String . valueOf ( folderItem . get ( GOORU_OID ) ) ; Object thumbnail = folderItem . get ( IMAGE_PATH ) ; if ( thumbnail != null ) { final Map < String , Object > thumbnails = new HashMap < String , Object > ( ) ; StringBuilder url = new StringBuilder ( ConfigProperties . getBaseRepoUrl ( ) ) ; url . append ( thumbnail ) ; thumbnails . put ( URL , url . toString ( ) ) ; folderItem . put ( THUMBNAILS , thumbnails ) ; } if ( fetchChildItem ) { if ( ( ( typeName . equalsIgnoreCase ( COLLECTION ) ) || ( typeName . equalsIgnoreCase ( ASSESSMENT ) ) ) || ( typeName . equalsIgnoreCase ( ASSESSMENT_URL ) ) ) { folderItem . put ( COLLECTION_ITEMS , getCollectionItem ( collectionGooruOid , sharing , collectionType , 4 , fetchChildItem , orderBy , excludeType ) ) ; folderItem . put ( ITEM_COUNT , this . getCollectionRepository ( ) . getCollectionItemCount ( collectionGooruOid , sharing , collectionType , excludeType ) ) ; } else if ( typeName . equalsIgnoreCase ( FOLDER ) ) { folderItem . put ( COLLECTION_ITEMS , getFolderItem ( collectionGooruOid , itemLimit , 0 , sharing , collectionType , orderBy , itemLimit , fetchChildItem , null , excludeType ) ) ; folderItem . put ( ITEM_COUNT , this . getCollectionRepository ( ) . getCollectionItemCount ( collectionGooruOid , sharing , collectionType , excludeType ) ) ; } } Object data = folderItem . get ( DATA ) ; if ( data != null ) { folderItem . put ( SETTINGS , JsonDeserializer . deserialize ( String . valueOf ( data ) , new TypeReference < Map < String , String > > ( ) { } ) ) ; folderItem . remove ( DATA ) ; } return folderItem ; } @ Override public List < Map < String , Object > > getFolderItem ( final String gooruOid , final Integer limit , Integer offset , final String sharing , final String collectionType , final String orderBy , final Integer itemLimit , final boolean fetchChildItem , final String sortOrder , final String excludeType ) { } @ Override public Map < String , Object > getFolderList ( final Integer limit , final Integer offset , final String gooruOid , final String title , final String username ) { } @ Override public SearchResults < Code > getCollectionStandards ( final Integer codeId , final String query , final Integer limit , final Integer offset , final User user ) { } private Errors validateUpdateCollectionItem ( final CollectionItem collectionItem ) throws Exception { } @ Override public List < CollectionItem > assignCollection ( final String classpageId , final String collectionId , final User user , final String direction , final String planedEndDate , final Boolean isRequired , final String minimumScore , final String estimatedTime , final Boolean showAnswerByQuestions , final Boolean showAnswerEnd , final Boolean showHints ) throws Exception { }

Fix:
final String typeName = String . valueOf ( folderItem . get ( TYPE ) ) ;