@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null) { return false; } if (!(o instanceof Student)) { return false; } final Student other = (Student) o; return name.equals(other.getName()); }