Skip to content

Instantly share code, notes, and snippets.

@yp-palF
Last active December 29, 2018 20:05
Show Gist options
  • Save yp-palF/694d9d88f790927fb44f66d94996ab8b to your computer and use it in GitHub Desktop.
Save yp-palF/694d9d88f790927fb44f66d94996ab8b to your computer and use it in GitHub Desktop.
LAMBDA BLOG: Main file with lambda
class BookMyMovie {
public static void main (String[] args) throws Exception {
// List<Movie> movies = List of movies
Filter horrorMovieFilter = (movie) -> movie.getGenre().equals(MovieType.HORROR);
for (Movie movie : movies) {
System.out.println("Movie: " + movie.getName() + " is Horror? " + horrorMovieFilter.isApplicable(movie));
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment