I can't seem to figure out why I'm getting this error on the
IDE Unexpected return value
when I need to return something from a method when using lambda.
public Employee getEmployee(long id) {
repository.findById(id).ifPresentOrElse(
empDetails -> {
return service.buildEmployee(empDetails);
},
() -> { throw new ResourceNotFoundException(); }
);
}
Thank you!