public Spring(NetworkGraph graph, Mass source, Mass destination) {
        if (graph == null || source == null || destination == null) {
            throw new IllegalArgumentException("The arguments may not be null.");
        }

        this.graph = graph;
        this.source = source;
        this.destination = destination;
        this.line = new Line2D.Double(source.getX(), source.getY(),
                destination.getX(), destination.getY());

        evaluateConnectionType();
    }