if (obj instanceof Exam) { Exam examObj = (Exam) obj;
if (obj instanceof IExam) { IExam examObj = (IExam) obj;
    public boolean equals(Object obj) {        if (obj instanceof Exam) {            Exam examObj = (Exam) obj;            return this.getIdInternal().equals(examObj.getIdInternal());        }        return false;    }