Code example for SortedSet

Methods: last, size

0
		this.maxNumberOfEntries = maxNumberOfEntries;
		this.nextEntryID = 0;
	} 
	 
	public boolean isTopScore(int score) {
		return entries.size() < this.maxNumberOfEntries || score < entries.last().getScore();
	} 
	 
	public void addScore(String name, int score) {
		if (name == null) {
			throw new NullPointerException();
		} 
 
		entries.add(new ScoreboardEntry(nextEntryID++, name, score));
		 
		if (entries.size() > maxNumberOfEntries) {
			entries.remove(entries.last());
		} 
	} 
	 
	public SortedSet<ScoreboardEntry> getEntries() {