I have a List of Java Objects (assume getters and setters):
Record(String name, String part, String value);
I need to return a boolean for if the list contains a certain name value and a certain part value.
I have it working for one filter at a time:
//assume records are added to this list
List<Record> masterList = new ArrayList<Record>();
boolean check = masterList.stream().map(Record::getName).filter(record.getName()::equals).findFirst().isPresent();
But I get error Non-static method cannot be referenced from a static context on Record::getPart for this attempt:
masterList.stream().map(Record::getName).filter(record.getName()::equals).map(Record::getPart).filter(record.getPart()::equals).findFirst().isPresent();