int getNeighboringIndex(Vector<Integer> coil, int i, int indexToIgnore) {
        Vector<Integer> neighboringIndexes = getNeighboringIndexes(coil.get(i));
        for (int index : neighboringIndexes) {
            int pos = coil.indexOf(index);
            if ((pos >= 0) && (pos < i) && (pos != coil.indexOf(indexToIgnore))) {
                return index;
            }
        }
        return -1;
    }