public void replacePackage(int index, Package replacement) {
        if (index >= packages.size()) {

        } else if (replacement == null) {
            packages.remove(index);
        } else if (replacement.isEmpty()) {
            packages.remove(index);
        } else {
            packages.set(index, replacement);
        }
    }