I have couple of objects:
public class RequestHostel {
private Hostel name;
}
and
public class Hostel {
private String value;
}
and I would like to know if it is possible to group by the value of Hostel, something like
.stream().collect(Collectors.groupingBy(RequestHostel::getName::getValue, counting()))