Fixed type cast error in Graph.java