Graph Implementation in Java using Set and Map
As of now, you only use LinkedHashSet and LinkedHashMap, thus declaring edgeSet and vertexMap as HashSet and HashMap is pointless. You could deploy Inversion of Control in order to demand some Set and Map at construction.



Method getEdges(...) could possibly return null, so you may want to wrap the return value in an Optional. Using Optional, you can also unify the behaviour of Map#get(Object) (which may or may not throw a NPE if a null is passed as argument):

public Optional&lt;Set&lt;Edge&gt;&gt; getEdges(Vertex vertex)
{
    Optional&lt;Set&lt;Edge&gt;&gt; result = Optional.empty();
    try 
    {
        result = Optional.ofNullable(vertex);
    }
    catch (NullPointerException e)
    {
        // No action needed, we return an empty Optional
    }
    return result;
}




Your remove...(...)-methods throw a NPE if the Vertex/Edge provided is not contained within the graph or is null. As with Map#get(Object), Set#remove(Object) may or may not throw a NPE. You can rewrite them to not throw:

public void removeVertex(Vertex vertex)
{
    Optional&lt;Set&lt;Edge&gt;&gt; deleteEdges = getEdges(vertex);
    if (deleteEdges.isPresent())
    {
        vertexSetMap.remove(vertex);
        edgeSet.removeAll(deleteEdges.get());
        vertexSetMap.keySet().forEach(vertex1 -&gt;
                vertexSetMap.get(vertex1).removeAll(deleteEdges.get()));
    }
}

public void removeEdge(Edge edge)
{
    try
    {
        if (edgeSet.remove(edge))
        {
            Vertex v1 = edge.getVertex1();
            Vertex v2 = edge.getVertex2();
            vertexSetMap.get(v1).remove(edge);
            vertexSetMap.get(v2).remove(edge);
        }
    }
    catch (NullPoionterException e)
    {
        // No action needed, there is nothing to remove.
    }
}




When you add methods

public boolean containsVertex(Vertex vertex)
public boolean getOther(Vertex vertex)


To your Edge-class, you can rewrite getNeighborsOf(...) to use Streams

public Set&lt;Vertex&gt; getNeighborsOf(Vertex vertex) {
    return vertexSetMap.get(vertex).stream()
          .filter(edge -&gt; edge.contains(vertex))
          .map(edge -&gt; edge.getOther(vertex))
          .collect(Collectors.toSet());
}




What is missing is a Set&lt;Vertex&gt; getVertices() method (you have one for Edges, so I would expect one for Vertexs as well). This would probably require creating an additional field Set&lt;Vertex&gt; vertices in your Graph class.