doesn't scenario have an addNeighbor method with only one argument that takes the required field? i would guess that there is a way to add a neighbor without a null edgeValue. if so, you should do that when the nbr doesn't have an edge value and do the inside of if if it does have an edge value.