use java.util.Iterator and modify graph add adjs logic