ソースを参照

:sparkles: 代码优化

如梦技术 6 年 前
コミット
083b42c2fb

+ 5 - 6
blade-core-tool/src/main/java/org/springblade/core/tool/node/NodeTest.java

@@ -13,7 +13,7 @@ import java.util.List;
 public class NodeTest {
 
 	public static void main(String[] args) {
-		List<INode> list = new ArrayList<>();
+		List<ForestNode> list = new ArrayList<>();
 		list.add(new ForestNode(1, 0, "1"));
 		list.add(new ForestNode(2, 0, "2"));
 		list.add(new ForestNode(3, 1, "3"));
@@ -24,11 +24,10 @@ public class NodeTest {
 		list.add(new ForestNode(8, 5, "8"));
 		list.add(new ForestNode(9, 6, "9"));
 		list.add(new ForestNode(10, 9, "10"));
-		List<INode> tns = ForestNodeMerger.merge(list);
-		tns.forEach(node -> {
-			ForestNode n = (ForestNode) node;
-			System.out.println(JsonUtil.toJson(n));
-		});
+		List<ForestNode> tns = ForestNodeMerger.merge(list);
+		tns.forEach(node ->
+			System.out.println(JsonUtil.toJson(node))
+		);
 	}
 
 }