короче, вы можете сделать что-то вроде этого,
employees.stream().
filter(hrc -> hrc.empid == 11 && hrc.date.equals("28-02-2000")).
min((o1, o2) -> o2.version - o1.version).orElse(null);
полный пример,
public static void main(String[] args) {
RnD rnD = new RnD();
rnD.test();
}
private void test() {
List<Hrc> employees = new ArrayList<>();
employees.add(new Hrc(11, "28-02-2000", 1));
employees.add(new Hrc(11, "28-02-2000", 2));
employees.add(new Hrc(11, "28-02-2000", 3));
employees.add(new Hrc(11, "30-02-2000", 1));
employees.add(new Hrc(22, "11-02-2000", 1));
Hrc topVersion= employees.stream().
filter(hrc -> hrc.empid == 11 && hrc.date.equals("28-02-2000")).
min((o1, o2) -> o2.version - o1.version).orElse(null);
System.out.println(topVersion);
}
private static class Hrc {
int empid;
String date;
int version;
public Hrc(int empid, String date, int version) {
this.empid = empid;
this.date = date;
this.version = version;
}
@Override
public String toString() {
return "Hrc{" +
"empid=" + empid +
", date='" + date + '\'' +
", version=" + version +
'}';
}
}