Created
February 7, 2017 12:55
-
-
Save haydarai/813ac39123b9e50241f801b8c5978240 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
List<Post> posts = ...; // Fill the list with data | |
List<Post> filteredPost = new ArrayList<>(); | |
// Iterate through the collection | |
for (Post post : posts) { | |
if (post.getAuthor().equals("Haydar") // The filter condition | |
filteredPost.add(post); // Adding the filtered item to the filtered collection | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment