public void removeRelationshipsNotConnectedToElement ( Element element ) { if ( element != null ) { getRelationships ( ) . stream ( ) . map ( RelationshipView :: getRelationship ) . filter ( r -> ! r . getSource ( ) . equals ( element ) && ! r . getDestination ( ) . equals ( element ) ) . forEach ( this :: remove ) ; } }
Removes relationships that are not connected to the specified element .