Java stream find specific element by Subject interestedSubject = subjects.stream() .filter(subject -> "Java".equals(subject.getName())) .findAny() .orElse(null);Subject interestedSubject = subjects.stream() .filter(subject -> "Java".equals(subject.getName())) .findAny() .orElse(null); Please Share