class PropertyWriterUtils {

    @SuppressWarnings("unchecked")
    public static Optional<Node<View, Edge>> getDockSourceNode(final Node<? extends View, ?> node) {
        return node.getInEdges().stream()
                .filter(PropertyWriterUtils::isDockEdge)
                .map(Edge::getSourceNode)
                .map(n -> (Node<View, Edge>) n)
                .findFirst();
    }

}