You should use containsKey
on your Hashtable instead of contains
on this line:
if (!tableTeamNameAndPoints.contains(winningTeamName)) {
When you use contains
, you're checking if the Hashtable contains a key that maps to the value provided. It's equivalent to the containsValue
method.
You can also remove the second if
statement which is not needed (the condition is always true
) and has the same contains
problem:
if (tableTeamNameAndPoints.contains(winningTeamName)) {