public void replaceLast(Element element) {
        {
            final Element removed = elements.removeLast();
            fireElementRemoved(removed);
            elements.add(element);
            fireElementAdded(element);
        }
        if (element instanceof Obstacle) {
            final Obstacle removed = obstacles.removeLast();
            fireObstacleRemoved(removed);
            obstacles.add((Obstacle) element);
            fireObstacleAdded((Obstacle) element);
        }
        if (element instanceof AccessPoint) {
            final AccessPoint removed = aps.removeLast();
            fireAccessPointRemoved(removed);
            aps.add((AccessPoint) element);
            fireAccessPointAdded((AccessPoint) element);
        }
    }