All Downloads are FREE. Search and download functionalities are using the official Maven repository.

someproject.me.tomassetti.Agenda Maven / Gradle / Ivy

package me.tomassetti;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

public class Agenda {

    private List persons = new ArrayList<>();

    public void addPerson(Person person) {
        persons.add(person);
    }

    public List
findAddressesOfPersons(String personName) { return persons.stream(). filter(p -> p.getName().equals(personName)). map(p -> p.getAddress()). collect(Collectors.toList()); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy