Graph Matching in Java