private boolean touchVertically(Line first, Line second ) {

        Point fEnd = first.getEnd();
        Point sEnd = second.getEnd();

        if (fEnd.getX() != sEnd.getX()) {
            return false;
        }

        Point fStart = first.getStart();
        Point sStart = second.getStart();

        if ((fStart.getY() <= sStart.getY() && fEnd.getY() >= sStart.getY() && fEnd.distanceTo(sStart) != 0)
            ||
        ( fStart.getY() >= sStart.getY() && fStart.getY() <= sEnd.getY() && fStart.distanceTo(sEnd) !=0 ) )
        {
            return true;
        }

        return false;
    }