Indentation fixes
This commit is contained in:
parent
9c152ce3bd
commit
a78b189d69
@ -20,10 +20,10 @@ public class FirstMatchingElementUnitTest {
|
|||||||
@Test
|
@Test
|
||||||
public void whenCalled_thenFindIndexUsingStream() {
|
public void whenCalled_thenFindIndexUsingStream() {
|
||||||
int index = dataList.stream()
|
int index = dataList.stream()
|
||||||
.filter(data -> data instanceof Boolean)
|
.filter(data -> data instanceof Boolean)
|
||||||
.mapToInt(data -> dataList.indexOf(data))
|
.mapToInt(data -> dataList.indexOf(data))
|
||||||
.findFirst()
|
.findFirst()
|
||||||
.orElse(-1);
|
.orElse(-1);
|
||||||
assertEquals(1, index);
|
assertEquals(1, index);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -57,9 +57,9 @@ public class FirstMatchingElementUnitTest {
|
|||||||
@Test
|
@Test
|
||||||
public void whenCalled_thenFindIndexUsingIntStream() {
|
public void whenCalled_thenFindIndexUsingIntStream() {
|
||||||
int index = IntStream.range(0, dataList.size() - 1)
|
int index = IntStream.range(0, dataList.size() - 1)
|
||||||
.filter(streamIndex -> dataList.get(streamIndex) instanceof Boolean)
|
.filter(streamIndex -> dataList.get(streamIndex) instanceof Boolean)
|
||||||
.findFirst()
|
.findFirst()
|
||||||
.orElse(-1);
|
.orElse(-1);
|
||||||
assertEquals(1, index);
|
assertEquals(1, index);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -67,10 +67,10 @@ public class FirstMatchingElementUnitTest {
|
|||||||
public void whenCalled_thenFindIndexUsingStreamTakeWhile() {
|
public void whenCalled_thenFindIndexUsingStreamTakeWhile() {
|
||||||
int lastIndex = dataList.size() - 1;
|
int lastIndex = dataList.size() - 1;
|
||||||
int predicateIndex = dataList.stream()
|
int predicateIndex = dataList.stream()
|
||||||
.takeWhile(data -> !(data instanceof Boolean))
|
.takeWhile(data -> !(data instanceof Boolean))
|
||||||
.mapToInt(dataList::indexOf)
|
.mapToInt(dataList::indexOf)
|
||||||
.max()
|
.max()
|
||||||
.orElse(-1);
|
.orElse(-1);
|
||||||
|
|
||||||
if (predicateIndex != 1 && predicateIndex != lastIndex) {
|
if (predicateIndex != 1 && predicateIndex != lastIndex) {
|
||||||
assertEquals(1, predicateIndex + 1);
|
assertEquals(1, predicateIndex + 1);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user