private void add(boolean bool, int[] array, int position) {
if (!bool) {
throw new IllegalArgumentException("preCondition not allow!!");
}
if (array == null) {
throw new NullPointerException("array is null!!");
}
if (array.length == 0) {
throw new IllegalArgumentException("array length is 0!!");
}
if (position > array.length || position < 0) {
throw new ArrayIndexOutOfBoundsException("position error!!");
}
//ok, do something...
}