HopcroftKarp class converted to use generic type parameter