@Test public void shouldNotRemoveMissingElement() { final Integer[] result = ArrayUtil.remove(values, THREE); assertArrayEquals(values, result); }
public static <T> T[] remove(final T[] oldElements, final T elementToRemove) { final int length = oldElements.length; int index = UNKNOWN_INDEX; for (int i = 0; i < length; i++) { if (oldElements[i] == elementToRemove) { index = i; } } return remove(oldElements, index); }
ArrayUtil { public static <T> T[] remove(final T[] oldElements, final T elementToRemove) { final int length = oldElements.length; int index = UNKNOWN_INDEX; for (int i = 0; i < length; i++) { if (oldElements[i] == elementToRemove) { index = i; } } return remove(oldElements, index); } }
ArrayUtil { public static <T> T[] remove(final T[] oldElements, final T elementToRemove) { final int length = oldElements.length; int index = UNKNOWN_INDEX; for (int i = 0; i < length; i++) { if (oldElements[i] == elementToRemove) { index = i; } } return remove(oldElements, index); } private  ArrayUtil(); }
ArrayUtil { public static <T> T[] remove(final T[] oldElements, final T elementToRemove) { final int length = oldElements.length; int index = UNKNOWN_INDEX; for (int i = 0; i < length; i++) { if (oldElements[i] == elementToRemove) { index = i; } } return remove(oldElements, index); } private  ArrayUtil(); static T[] add(final T[] oldElements, final T elementToAdd); static T[] remove(final T[] oldElements, final T elementToRemove); static T[] remove(final T[] oldElements, final int index); @SuppressWarnings("unchecked") static T[] newArray(final T[] oldElements, final int length); static T[] ensureCapacity(final T[] oldElements, final int requiredLength); }
ArrayUtil { public static <T> T[] remove(final T[] oldElements, final T elementToRemove) { final int length = oldElements.length; int index = UNKNOWN_INDEX; for (int i = 0; i < length; i++) { if (oldElements[i] == elementToRemove) { index = i; } } return remove(oldElements, index); } private  ArrayUtil(); static T[] add(final T[] oldElements, final T elementToAdd); static T[] remove(final T[] oldElements, final T elementToRemove); static T[] remove(final T[] oldElements, final int index); @SuppressWarnings("unchecked") static T[] newArray(final T[] oldElements, final int length); static T[] ensureCapacity(final T[] oldElements, final int requiredLength); static final int UNKNOWN_INDEX; static final boolean[] EMPTY_BOOLEAN_ARRAY; static final byte[] EMPTY_BYTE_ARRAY; static final char[] EMPTY_CHAR_ARRAY; static final short[] EMPTY_SHORT_ARRAY; static final int[] EMPTY_INT_ARRAY; static final float[] EMPTY_FLOAT_ARRAY; static final long[] EMPTY_LONG_ARRAY; static final double[] EMPTY_DOUBLE_ARRAY; static final Object[] EMPTY_OBJECT_ARRAY; static final String[] EMPTY_STRING_ARRAY; static final int MAX_CAPACITY; }