public int compareTo(Osoba other) { Student otherStudent = (Student) other; if ((getNazwisko().compareTo(otherStudent.getNazwisko()) == 0)) { if ((getDataUrodzenia().compareTo(otherStudent.getDataUrodzenia()) == 0)) { if ((this.sredniaOcen == otherStudent.sredniaOcen)) { return 0; } else if(this.sredniaOcen < otherStudent.sredniaOcen) return -1; else return 1; } else return getDataUrodzenia().compareTo(otherStudent.getDataUrodzenia()); } else return getNazwisko().compareTo(otherStudent.getNazwisko()); }