There is a class
public class Entity { private String firstName; public String getFirstName() { return firstName; } } There is an Item class that contains an Entity entity field:
public class Item { private Entity entity; public Entity getEntity() { return entity; } There are ArraList items. I want to get a list of all firstName from it using stream. I am writing this code, but AndroidStudio swears at it:
List<String> items = Item.items.stream().map(item -> item.getEntity().getFirstName().toString()).toArray();