int i = getIndex(n);
    public void remove(Array n) throws Exception {        Array refs = getReferences();        if (refs != null) {            int i = getIndex(n);            if (i > -1) {                names.remove(i);                refs.remove(i);            }        } else {            throw new Exception("Could not remove element. The references is null.");        }    }