class UndirectedGraphImpl implements UndirectedGraph<V, E> {

    @Override
    public List<E> getEdgeObjects(int v1, int v2) {
        checkVertex(v1);
        checkVertex(v2);
        List<E> edgeObjects = new ArrayList<>(1);
        TIntArrayList[] adjacencyList = getAdjacencyList();
        TIntArrayList adjacentEdges = adjacencyList[v1];
        for (int i = 0; i < adjacentEdges.size(); i++) {
            int e = adjacentEdges.getQuick(i);
            Edge<E> edge = edges.get(e);
            if ((edge.getV1() == v1 && edge.getV2() == v2)
                    || (edge.getV1() == v2 && edge.getV2() == v1)) {
                edgeObjects.add(edge.getObject());
            }
        }
        return edgeObjects;
    }

}