I have this class:
public class AirbnbListing {
...
private int price
...
public int getPrice() { return price; }
And I'm trying to use a java stream to collect the integer prices from an ArrayList of AirbnbListing objects:
ArrayList<AirbnbListing> properties = dataParser.getNeighbourhoodProperties(neighbourhood, 0, -1, 0, "All");
ArrayList<Integer> prices =
properties.stream()
.map(AirbnbListing::getPrice)
.collect(Collectors.toList());
But I'm getting "Incompatiable types: inferenance variable R has incompatible bounds". Not sure what the issue is.