void (int val) { int pos = indexOf(val); if (pos >= 0) return; if (mySize == myData.length) { myData = Arrays.copyOf(myData, mySize * 3 / 2 + 1); } System.arraycopy(myData, -pos - 1, myData, -pos, mySize + pos + 1); myData[-pos - 1] = val; mySize++; }