src/main/java/tsz/game/service/AchievementService.java
/**
	 * Decide whether the player earned the 'Champion on medium' achievement.
	 * @param listOfData - collection of all gameplay data.
	 * @param playername - name of the actual player.
	 * @return whether the given player's perfomance is eligable to unlock the 'Champion on medium' achievement.
	 */
Decide whether the player earned the 'Champion on medium' achievement.
@param listOfData - collection of all gameplay data.
@param playername - name of the actual player.
@return whether the given player's perfomance is eligable to unlock the 'Champion on medium' achievement.
Decide whether the player earned the ' Champion on medium ' achievement . @param listOfData - collection of all gameplay data . @param playername - name of the actual player . @return whether the given player ' s perfomance is eligable to unlock the ' Champion on medium ' achievement .
public boolean isChampionOnMedium(Collection<GameData> listOfData, String playername) {
		logger.info("Champion on medium achievement checked.");
		List<GameData> tempForData = listOfData.stream()
					.filter(d -> d.getDifficulty().equals("medium"))
					.sorted((d1,d2) -> d2.getFinalScore() - d1.getFinalScore())
					.collect(Collectors.toList());
		if(tempForData.size() > 0) {
			return tempForData.get(0).getPlayerName().equals(playername);
		} else {
			return false;
		}
	}
public boolean isChampionOnMedium ( Collection < GameData > listOfData , String playername ) { logger . info ( "Champion on medium achievement checked." ) ; List < GameData > tempForData = listOfData . stream ( ) . filter ( d -> d . getDifficulty ( ) . equals ( "medium" ) ) . sorted ( ( d1 , d2 ) -> d2 . getFinalScore ( ) - d1 . getFinalScore ( ) ) . collect ( Collectors . toList ( ) ) ; if ( tempForData . size ( ) > 0 ) { return tempForData . get ( 0 ) . getPlayerName ( ) . equals ( playername ) ; } else { return false ; } }
Decide whether the player earned the 'Champion on medium' achievement.
Decide whether the player earned the ' Champion on medium ' achievement .