formatting change

This commit is contained in:
Niket Agrawal 2023-11-07 23:14:34 +05:30
parent 2628fe1eb0
commit c7bd43e881
1 changed files with 4 additions and 4 deletions

View File

@ -46,10 +46,10 @@ public class FirstMatchingElementUnitTest {
int lastIndex = userList.size() - 1; int lastIndex = userList.size() - 1;
AtomicInteger counter = new AtomicInteger(-1); AtomicInteger counter = new AtomicInteger(-1);
int predicateIndex = userList.stream() int predicateIndex = userList.stream()
.takeWhile(user -> { .takeWhile(user -> {
counter.getAndIncrement(); counter.getAndIncrement();
return !(searchName.equals(user.getUserName())); return !(searchName.equals(user.getUserName()));
}) })
.mapToInt(user -> counter.get()) .mapToInt(user -> counter.get())
.max() .max()
.orElse(-1); .orElse(-1);