Exercise from second lesson (by Narek Karapetian)#166
Open
NarekDW wants to merge 3 commits intojava8-course:masterfrom
Open
Exercise from second lesson (by Narek Karapetian)#166NarekDW wants to merge 3 commits intojava8-course:masterfrom
NarekDW wants to merge 3 commits intojava8-course:masterfrom
Conversation
senia-psm
reviewed
Jul 4, 2017
| throw new UnsupportedOperationException(); | ||
| }; | ||
| private Predicate<Person> negate1(Predicate<Person> predicate) { | ||
| return p -> predicate.negate().test(p); |
Contributor
There was a problem hiding this comment.
Don't use Predicate::negate here.
| // TODO | ||
| throw new UnsupportedOperationException(); | ||
| }; | ||
| return p -> t1.test(p) & t2.test(p); |
Contributor
There was a problem hiding this comment.
Why not &&? What is the difference between these operators? Are you sure you need & here?
Author
There was a problem hiding this comment.
Using && here is more correctly, you are right. I just mixed up the functionality between && and &.
In this case if t1.test(p) is false operator && won't call the second expression couse it's senselessly.
senia-psm
reviewed
Jul 5, 2017
| new Person("aa", "b", 1))); | ||
| } | ||
| } | ||
| package lambda.part2.exercise; |
Contributor
There was a problem hiding this comment.
This diff is unreadable. I suspect you've changed line endings.
Fix it.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.