### Question:
ArrayCreator { public static Optional<Array> createArray(Type type) { return createArray(null, type, false); } private  ArrayCreator(); static Optional<Array> createArray(Type type); static Optional<Array> createArray(Type type, boolean batched); static Optional<Array> createArray(Type fieldType, Type methodType); static Optional<Array> createArray(Type fieldType, Type methodType, boolean batched);  }### Answer:
@Test public void shouldCreateArrayForJavaArray() { final ArrayType type = ArrayType.create(STRING_TYPE, 1); assertTrue(ArrayCreator.createArray(type).isPresent()); }
@Test public void shouldCreateArrayForCompletionStageBatchedList() { final ParameterizedType stringList = ParameterizedType.create(DotName.createSimple(List.class.getName()), new Type[] { STRING_TYPE }, null); final ParameterizedType stringStringList = ParameterizedType.create(DotName.createSimple(List.class.getName()), new Type[] { stringList }, null); final ParameterizedType completionStage = ParameterizedType.create(Classes.COMPLETION_STAGE, new Type[] { stringStringList }, null); assertTrue(ArrayCreator.createArray(completionStage, true).isPresent()); }
@Test public void shouldCreateArrayForCollection() { final ParameterizedType type = ParameterizedType.create(Classes.COLLECTION, new Type[] { STRING_TYPE }, null); assertTrue(ArrayCreator.createArray(type).isPresent()); }
@Test public void shouldCreateArrayForSet() { final ParameterizedType type = ParameterizedType.create(SET, new Type[] { STRING_TYPE }, null); assertTrue(ArrayCreator.createArray(type).isPresent()); }
@Test public void shouldCreateArrayForLinkedList() { final ParameterizedType type = ParameterizedType.create(LINKED_LIST, new Type[] { STRING_TYPE }, null); assertTrue(ArrayCreator.createArray(type).isPresent()); }
@Test public void shouldNotCreateArrayForOptional() { final ParameterizedType type = ParameterizedType.create(Classes.OPTIONAL, new Type[] { STRING_TYPE }, null); assertFalse(ArrayCreator.createArray(type).isPresent()); }
@Test public void shouldNotCreateArrayForCompletableFuture() { final ParameterizedType type = ParameterizedType.create(Classes.COMPLETABLE_FUTURE, new Type[] { STRING_TYPE }, null); assertFalse(ArrayCreator.createArray(type).isPresent()); }
@Test public void shouldNotCreateArrayForCompletionStage() { final ParameterizedType type = ParameterizedType.create(Classes.COMPLETION_STAGE, new Type[] { STRING_TYPE }, null); assertFalse(ArrayCreator.createArray(type).isPresent()); }
@Test public void shouldCreateArrayForCompletionStageOfList() { final ParameterizedType stringList = ParameterizedType.create(DotName.createSimple(List.class.getName()), new Type[] { STRING_TYPE }, null); final ParameterizedType type = ParameterizedType.create(Classes.COMPLETION_STAGE, new Type[] { stringList }, null); assertTrue(ArrayCreator.createArray(type).isPresent()); }
@Test public void shouldCreateArrayForCompletionStageOfArray() { final ArrayType stringArray = ArrayType.create(STRING_TYPE, 1); final ParameterizedType type = ParameterizedType.create(Classes.COMPLETION_STAGE, new Type[] { stringArray }, null); assertTrue(ArrayCreator.createArray(type).isPresent()); }
@Test public void shouldNotCreateArrayForCompletionStageBatched() { final ParameterizedType stringList = ParameterizedType.create(DotName.createSimple(List.class.getName()), new Type[] { STRING_TYPE }, null); final ParameterizedType completionStage = ParameterizedType.create(Classes.COMPLETION_STAGE, new Type[] { stringList }, null); assertFalse(ArrayCreator.createArray(completionStage, true).isPresent()); }