Fixed inDegree when creating subgraphs.
Added JUnit test to cover inDegree of nodes.