У меня есть набор данных ниже в моей программе Java: < /p>
public Actor tomCruise = new Actor("Tom Cruise", 40, "Male");
public Actor tony = new Actor("Tony Stark", 39, "Male");
public Actor chris = new Actor("Chris", 42, "Male");
public Actor johnny = new Actor("Johnny Depp", 35, "Male");
public Actor emma = new Actor("Emma Watson", 32, "Female");
public Actor alexandra = new Actor("Alexandra Anna Daddario", 34, "Female");
public Actor amy = new Actor("Amy Lou Adams", 38, "Female");
public List actorsMasterList = new ArrayList(Arrays.asList(tomCruise, tony, chris, johnny, emma, amy));
public Movie movie1 = new Movie("Movie1", 2, "Bollywood", new ArrayList(Arrays.asList(tomCruise, tony, emma)), 2002);
public Movie movie2 = new Movie("Movie2", 1, "Hollywood", new ArrayList(Arrays.asList(tomCruise, tony, amy, chris)), 2004);
public Movie movie3 = new Movie("Movie3Movie", 3, "Bollywood", new ArrayList(Arrays.asList(tomCruise, tony, amy, johnny, chris)), 2004);
public List moviesMasterList = new ArrayList(Arrays.asList(movie1, movie2, movie3));
< /code>
Теперь мне нужно реализовать методы ниже, используя потоки Java 8: < /p>
// get the actor who has not done any movie
public void getNotUsedActor() {
}
// get the actor who has done most number of movies
public void getMostUsedActor() {
}
// get the actor who has done minimum number of movies
public void getLeastUsedActor() {
}
Подробнее здесь: https://stackoverflow.com/questions/796 ... stream-api