Sprawdź, czy obiekt to pusta Java 8
// Changed EmployeeServive to return an optional, no more nulls!
Optional<Employee> employee = employeeServive.getEmployee();
employee.ifPresent(e -> System.out.println(e.getId()));
2 Programmers 1 Bug