mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-12-19 07:00:35 +08:00
style: include OI_OPTIONAL_ISSUES_USES_IMMEDIATE_EXECUTION (#5274)
This commit is contained in:
@@ -54,7 +54,7 @@ public class DepthFirstSearchTest {
|
||||
|
||||
// check value
|
||||
Optional<Node<Integer>> value = dfs.recursiveSearch(root, expectedValue);
|
||||
assertEquals(expectedValue, value.orElse(new Node<>(null)).getValue());
|
||||
assertEquals(expectedValue, value.orElseGet(() -> new Node<>(null)).getValue());
|
||||
|
||||
// check path
|
||||
assertArrayEquals(expectedPath.toArray(), dfs.getVisited().toArray());
|
||||
@@ -67,7 +67,7 @@ public class DepthFirstSearchTest {
|
||||
|
||||
// check value
|
||||
Optional<Node<Integer>> value = dfs.recursiveSearch(root, expectedValue);
|
||||
assertEquals(expectedValue, value.orElse(new Node<>(null)).getValue());
|
||||
assertEquals(expectedValue, value.orElseGet(() -> new Node<>(null)).getValue());
|
||||
|
||||
// check path
|
||||
assertArrayEquals(expectedPath.toArray(), dfs.getVisited().toArray());
|
||||
|
||||
Reference in New Issue
Block a user