question: public PieData findMostPlayedData ( StatisticType type , List < Long > shownChallenges ) { ArrayList < Entry > entries = new ArrayList < > ( ) ; ArrayList < String > labels = new ArrayList < > ( ) ; List < Statistics > statistics ; statistics = mStatisticsDataSource . findByCategoryAndUser ( mCategoryId , mUser ) ; switch ( type ) { case TYPE_MOST_PLAYED : break ; case TYPE_MOST_FAILED : statistics = removeSucceeded ( statistics ) ; break ; case TYPE_MOST_SUCCEEDED : statistics = removeFailed ( statistics ) ; break ; default : return null ; } shownChallenges . addAll ( getMost ( entries , labels , statistics , NUMBER_PLAYED_LISTED ) ) ; if ( entries . size ( ) > 1 ) { PieDataSet dataset = new PieDataSet ( entries , "" ) ; mSettings . applyDataSetSettings ( dataset , type ) ; PieData data = new PieData ( labels , dataset ) ; mSettings . applyDataSettings ( data ) ; return data ; } else { return null ; } }
target:  Creates a PieData object containing entries of the most played / failed or succeded challenges. Which of these entries are added depends on the given mode. The ids of the challenges are also added to the shownChallenges list.