2 Edited for formatting and additional details.
source | link

The very first thing that stood out to me is the naming of your generics. Using Node as the name of the generic is very odd in the Java world. I would strongly suggest you rename the generic to a single letter. Java loves T for Type in cases for single generics or just the first letter of the concept it is trying to model. For example Map is Map, in the Java source, the generics for map are:

Map<K,V>

Not

Map<Key,Value>

This might seem like such a big deal but from experience it can lead to really stupid bugs and unintended behavior that is a pain to track down. A simple example. Say we have an interface like so:

public interface Foo {
    public void fizz();
}

And two classes:

public class Bar implements Foo {
    public void fizz(){
        System.out.println("Bar");
    }
}
public class Baz implements Foo {
    public void fizz(){
        System.out.println("Baz");
    }
}

And finally you have a class like this:

public class FooBarBaz<Bar extends Foo> {
    private Bar bar;

    public FooBarBaz(Bar bar){
        this.bar = bar;
    }

    public void callFizzOnBar(){
        this.bar.fizz();
    }

    public void main(String[] args){
        Baz baz = new Baz();
        FooBarBaz<Baz> fbb = new FooBarBaz<>(baz);
        fbb.callFizzOnBar();
    }
}

See how that can lead to issues? I am not Mapsaying your codes does this this this badly right now. But just writing code when even has the ability to go down this hole should be avoided.

The very first thing that stood out to me is the naming of your generics. Using Node as the name of the generic is very odd in the Java world. I would strongly suggest you rename the generic to a single letter. Java loves T for Type in cases for single generics or just the first letter of the concept it is trying to model. For example Map is Map and not Map.

The very first thing that stood out to me is the naming of your generics. Using Node as the name of the generic is very odd in the Java world. I would strongly suggest you rename the generic to a single letter. Java loves T for Type in cases for single generics or just the first letter of the concept it is trying to model. For example, in the Java source, the generics for map are:

Map<K,V>

Not

Map<Key,Value>

This might seem like such a big deal but from experience it can lead to really stupid bugs and unintended behavior that is a pain to track down. A simple example. Say we have an interface like so:

public interface Foo {
    public void fizz();
}

And two classes:

public class Bar implements Foo {
    public void fizz(){
        System.out.println("Bar");
    }
}
public class Baz implements Foo {
    public void fizz(){
        System.out.println("Baz");
    }
}

And finally you have a class like this:

public class FooBarBaz<Bar extends Foo> {
    private Bar bar;

    public FooBarBaz(Bar bar){
        this.bar = bar;
    }

    public void callFizzOnBar(){
        this.bar.fizz();
    }

    public void main(String[] args){
        Baz baz = new Baz();
        FooBarBaz<Baz> fbb = new FooBarBaz<>(baz);
        fbb.callFizzOnBar();
    }
}

See how that can lead to issues? I am not saying your codes does this this this badly right now. But just writing code when even has the ability to go down this hole should be avoided.

1
source | link

The very first thing that stood out to me is the naming of your generics. Using Node as the name of the generic is very odd in the Java world. I would strongly suggest you rename the generic to a single letter. Java loves T for Type in cases for single generics or just the first letter of the concept it is trying to model. For example Map is Map and not Map.