ArrayList consists of objects, each of which has a temperature and time.
It is necessary to find the maximum temperature for each day.
So far it turns out to find just the maximum temperature value as follows:
for (int i = 1; i < history.size(); i++) { if (history.get(0).getCelsius() > max && history.get(0).getDate().equals(history.get(i).getDate())) { max = history.get(0).getCelsius(); } } I am trying to figure out how to write it better, but nothing happens. Maybe there are some tips / tips. I understand that it is necessary to determine that history.get(i).getDate() should not be equal to history.get(i).getDate() with the same value, but I don’t know how to do it.