Comparator<Employee> comparator =Comparator.comparing(Employee::getIncome);
Employee minObj= Employee.persons().stream()
.min(comparator)
.get();
This is returning me address instead of an object.
toMap.Employee@66133adc
What is the problem and how to write it correctly?
It probably isn't—you have forgotten to override toString()
.