added setGraph for java compat