diff --git a/src/main/java/edu/hm/hafner/coverage/Node.java b/src/main/java/edu/hm/hafner/coverage/Node.java index d2f14d0c..b9c8e4a1 100644 --- a/src/main/java/edu/hm/hafner/coverage/Node.java +++ b/src/main/java/edu/hm/hafner/coverage/Node.java @@ -694,7 +694,7 @@ private String createTargetClassName(final ClassNode testClassNode) { * * @return a new tree with the merged {@link Node nodes} */ - public static Node merge(final List nodes) { + public static Node merge(final List nodes) { if (nodes.isEmpty()) { throw new IllegalArgumentException("Cannot merge an empty list of nodes"); } @@ -707,6 +707,7 @@ public static Node merge(final List nodes) { if (grouped.size() == 1) { return nodes.stream() + .map(Node.class::cast) .reduce(Node::merge) .orElseThrow(() -> new NoSuchElementException("No node found")); }