public static <T> T[] edit(T[] array, Editor<T> editor) {
		if (null == editor) {
			return array;
		}

		final ArrayList<T> list = new ArrayList<>(array.length);
		T modified;
		for (T t : array) {
			modified = editor.edit(t);
			if (null != modified) {
				list.add(modified);
			}
		}
		final T[] result = newArray(array.getClass().getComponentType(), list.size());
		return list.toArray(result);
	}
@Test
	public void filterEditTest() {
		Integer[] a = {1, 2, 3, 4, 5, 6};
		Integer[] filter = ArrayUtil.edit(a, t -> (t % 2 == 0) ? t : null);
		assertArrayEquals(filter, new Integer[]{2, 4, 6});
	}