Review comment update

This commit is contained in:
Niket Agrawal 2023-11-16 14:43:14 +05:30
parent ab70c92934
commit aa357f8b64
1 changed files with 1 additions and 6 deletions

View File

@ -43,7 +43,6 @@ public class FirstMatchingElementUnitTest {
@Test
public void whenUsingTakeWhile_thenFindFirstMatchingUserIndex() {
int lastIndex = userList.size() - 1;
AtomicInteger counter = new AtomicInteger(-1);
int predicateIndex = userList.stream()
.takeWhile(user -> {
@ -54,11 +53,7 @@ public class FirstMatchingElementUnitTest {
.max()
.orElse(-1);
if (predicateIndex != 1 && predicateIndex != lastIndex) {
assertEquals(1, predicateIndex + 1);
} else {
assertEquals(lastIndex, predicateIndex);
}
assertEquals(1, predicateIndex + 1);
}
@Test