Group students by grade and having max age Please help to improve my Java 7 code. I would like a best code logic to achieve this.

package main.java;

import java.util.ArrayList;
import java.util.List;

public class Student {
    private int id;
    private String grade;
    private int age;

    public Student(int id, String grade, int age){
        this.id = id;
        this.grade = grade;
        this.age = age;
    }

    public int getId() {
        return id;
    }
    public void setId(int id) {
        this.id = id;
    }
    public String getGrade() {
        return grade;
    }
    public void setGrade(String grade) {
        this.grade = grade;
    }
    public int getAge() {
        return age;
    }
    public void setAge(int age) {
        this.age = age;
    }

    // group student by grade and having max of age
    public static List&lt;Student&gt; getStudentsWithMaxAgeOfEachGrade(List&lt;Student&gt; students){
        ArrayList&lt;Student&gt; result = new ArrayList&lt;&gt;();

        for(Student s : students){
            boolean found = false;
            for(Student rs : result){
                if(rs.getGrade().equals(s.getGrade()) &amp;&amp; rs.getAge() &lt; s.getAge()){
                    found = true;
                    result.remove(rs);
                    result.add(s);
                    break;
                }
            }
            if(found == false){
                result.add(s);
            }
        }

        return result;

    }

    public static void main(String[] args) {
        List&lt;Student&gt; students = new ArrayList&lt;&gt;();
        Student s1 = new Student(1, "a", 32);
        Student s2 = new Student(2, "a", 34);
        Student s3 = new Student(3, "b", 23);

        students.add(s1);
        students.add(s2);
        students.add(s3);

        List&lt;Student&gt; result = getStudentsWithMaxAgeOfEachGrade(students);

        for(Student s : result){
            System.out.println(s.getGrade() + ":" + s.getAge());
        }
    }
}
in your code, you have getter and setter for id. But those methods are not used. I have posted a similar question before. And multiple people told me "we shouldn't have dead code." 

Since you want to return List of Student, I would construct the HashMap to map from string(grade) to Student instead of string to integer (where you will lose the student id).