How can we do it in Java? I've a 4 employee object, I see ssn is same in them, but I want to only get such records where version is latest.

```
public class MapDemo {
    public static void main(String[] args) {
        // Get the latest Schema version
        Employee employee = Employee.builder().firstName("John").lastname("Do").email("john.doe@gmail.com").ssn(12345).version(1).build();
        Employee employee1 = Employee.builder().firstName("John").lastname("Doe").email("john.doe@hotmail").ssn(12345).version(2).build();

        Employee employee2 = Employee.builder().firstName("Jane").lastname("K").email("jane.k@gmail").ssn(45678).version(20).build();
        Employee employee3 = Employee.builder().firstName("Jane").lastname("Kerr").email("jane.kerr@gmail").ssn(45678).version(28).build();

        List<Employee> employees = new ArrayList<>();
        employees.add(employee);
        employees.add(employee1);
        employees.add(employee2);
        employees.add(employee3);

        // I want latest version employee object here here its - employees1 and employees3

    }

```

Employee.java

```
@AllArgsConstructor
@NoArgsConstructor
@Data
@Builder
public class Employee {
    private String firstName;
    private String lastname;
    private String email;
    private int version;
    private int ssn;
}

```