replace NullPointerException to IndexOutOfBoundsException in method returning uniq instance