We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
merge
1 parent 047ce5f commit 767d01aCopy full SHA for 767d01a
src/main/java/edu/hm/hafner/coverage/Node.java
@@ -694,7 +694,7 @@ private String createTargetClassName(final ClassNode testClassNode) {
694
*
695
* @return a new tree with the merged {@link Node nodes}
696
*/
697
- public static Node merge(final List<Node> nodes) {
+ public static Node merge(final List<? extends Node> nodes) {
698
if (nodes.isEmpty()) {
699
throw new IllegalArgumentException("Cannot merge an empty list of nodes");
700
}
@@ -707,6 +707,7 @@ public static Node merge(final List<Node> nodes) {
707
708
if (grouped.size() == 1) {
709
return nodes.stream()
710
+ .map(Node.class::cast)
711
.reduce(Node::merge)
712
.orElseThrow(() -> new NoSuchElementException("No node found"));
713
0 commit comments