I am writing a method which return an int, a sum of points. The class has got an instance variable which is a SortedMap<Integer, Driver> drivers; where sum of points is stored. First, I have to check that SortedMap keys are between 1 and 4, inclusive, if it is true, get the points and return them.
So far my code doesn't compile, , compiler says; operator => cannot be applied to Driver, int
public int getPoints()
int teamPoints = 0;
if ((drivers.get("testmember") >= 1) && (drivers.get("testmember") <= 4))
teamPoints = teamPoints + driver.get("testmember")