Replaced Stream#forEach() with Collection#forEach()
And also replaced comparators to Compatator#comparing
Change-Id: I3759a872ee65ad6a4c660aa74ab893b67891c50f
diff --git a/src/main/java/org/opencord/cordvtn/cli/CordVtnNodeListCommand.java b/src/main/java/org/opencord/cordvtn/cli/CordVtnNodeListCommand.java
index 5c995f1..7086a09 100644
--- a/src/main/java/org/opencord/cordvtn/cli/CordVtnNodeListCommand.java
+++ b/src/main/java/org/opencord/cordvtn/cli/CordVtnNodeListCommand.java
@@ -23,7 +23,7 @@
import org.opencord.cordvtn.impl.CordVtnNodeManager;
import org.opencord.cordvtn.api.node.CordVtnNode;
-import java.util.Collections;
+import java.util.Comparator;
import java.util.List;
import static com.fasterxml.jackson.databind.SerializationFeature.INDENT_OUTPUT;
@@ -43,7 +43,7 @@
protected void execute() {
CordVtnNodeManager nodeManager = AbstractShellCommand.get(CordVtnNodeManager.class);
List<CordVtnNode> nodes = nodeManager.getNodes();
- Collections.sort(nodes, CordVtnNode.CORDVTN_NODE_COMPARATOR);
+ nodes.sort(Comparator.comparing(CordVtnNode::hostname));
if (outputJson()) {
try {