The simpliest graph interface is Graph<V, E> where V and E are extending the Vertice<V, E> and Edge<V, E> interfaces. All three interfaces take the vertice and edge interfaces as generic parameter. The clue behind this is that the [datastructures] will be therefore typesafe to their implementation of these interfaces: An edge implementation will always return the corresponding vertice implementation on its methods.