Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
andreisilviudragnea committed Mar 16, 2022
1 parent 07901f3 commit 08e2ad2
Showing 1 changed file with 3 additions and 5 deletions.
Expand Up @@ -126,15 +126,13 @@ public static Location getLastLocation(List<Invocation> invocations) {

public static Invocation findPreviousVerifiedInOrder(
List<Invocation> invocations, InOrderContext context) {
LinkedList<Invocation> verifiedOnly =
invocations.stream()
.filter(context::isVerified)
.collect(Collectors.toCollection(LinkedList::new));
List<Invocation> verifiedOnly =
invocations.stream().filter(context::isVerified).collect(Collectors.toList());

if (verifiedOnly.isEmpty()) {
return null;
} else {
return verifiedOnly.getLast();
return verifiedOnly.get(verifiedOnly.size() - 1);
}
}

Expand Down

0 comments on commit 08e2ad2

Please sign in to comment.