Skip to content
Permalink
Browse files

Step 8: Filtering by Probability

  • Loading branch information...
tlinkowski committed Jan 31, 2019
1 parent 31e9139 commit cf4e4d4d15a311780e10b8358be9a82c5453089d
Showing with 11 additions and 1 deletion.
  1. +5 −1 ProbabilisticIssueWiseText.java
  2. +6 −0 Usage.java
@@ -6,5 +6,9 @@
List<? extends ProbableIssue> issues();

@Override
ProbabilisticIssueWiseText filtered(Predicate<? super Issue> issueFilter);
default ProbabilisticIssueWiseText filtered(Predicate<? super Issue> issueFilter) {
return filteredProbabilistic(issueFilter);
}

ProbabilisticIssueWiseText filteredProbabilistic(Predicate<? super ProbableIssue> issueFilter);
}
@@ -11,6 +11,12 @@ static double issueCoverage(Stream<? extends IssueWiseText> textStream, IssueTyp
.collect(IssueCoverage.collector());
}

static double issueCoverage(Stream<? extends ProbabilisticIssueWiseText> textStream, double minProbability) {
return textStream
.map(text -> text.filteredProbabilistic(issue -> issue.probability() >= minProbability))
.collect(IssueCoverage.collector());
}

static Stream<IssueWiseText> testCaseStream() {
return Stream.of();
}

0 comments on commit cf4e4d4

Please sign in to comment.
You can’t perform that action at this time.