code: public RelationGraph filterByVertex(@NonNull Predicate<? super Annotation> vertexPredicate) {
        RelationGraph gPrime = new RelationGraph();
        vertices().stream().filter(vertexPredicate).forEach(gPrime::addVertex);
        edges().stream()
               .filter(e -> gPrime.containsVertex(e.getFirstVertex()) && gPrime.containsVertex(e.getSecondVertex()))
               .forEach(gPrime::addEdge);
        return gPrime;
     }
docs: Filters the graph by evaluating the edges using the given predicate. The vertices passing the predicate and
  their incident edges are used to construct a new filtered RelationGraph.
  
  @param vertexPredicate the vertex predicate
  @return the relation graph