Created
January 26, 2017 08:47
-
-
Save HelloThisIsFlo/7d123be3c4d4f176a28875bc228c5a5c 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
public class SomeClass { | |
XmlParser xmlParser; | |
public SomeClass(XmlParser xmlParser) { | |
this.xmlParser = xmlParser; | |
} | |
public List<Book> findSpecificBookInFile(String bookName, String filePath) { | |
List<Book> fromFile = xmlParser.parseBooks(fileName); | |
return fromFile.stream() | |
.filter(book -> bookName.equals(book.title())) | |
.findFirst() | |
.orElse(Book.NULL); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment