Edited:\" I received a very pertinent answer from \'erickson\', but there is a side problem (up-casting?) that was not explicitly covered in my original
For part 1, I would make the method signiture
static > void addNewNeighbors(Node super T> node, T newNode)
{
node.addNeighbor(newNode);
}
That way, node does not have to specifically be the same type as newNode.
For part 2, I would do something similar.
ConcreteNode super City> nc = new City("");
nc.addNeighbor(new City("Bern"));