  @Test
  public void
      testTypesGeneratorGeneratesCorrectTypesOnClassTypeWithArrayPropertyOnSimpleArrayItemTypes()
          throws InstantiationException, IllegalAccessException {

    Map<Class<? extends ArrayItem>, String> arrayItems = new HashMap<>();

    arrayItems.put(ObjectArrayItem.class, "Object");
    arrayItems.put(AnyArrayItem.class, "Object");
    arrayItems.put(StringArrayItem.class, "String");
    arrayItems.put(IntegerArrayItem.class, "Integer");
    arrayItems.put(NumberArrayItem.class, "Double");

    for (Map.Entry<Class<? extends ArrayItem>, String> arrayItem : arrayItems.entrySet()) {
      ArrayProperty arrayProperty = createProperty(ArrayProperty.class, "arrayPropertyName");

      arrayProperty.setDescription("Some property description");
      arrayProperty.setItems(arrayItem.getKey().newInstance());

      ObjectType objectType = createObjectType("someObjectType1", "Description1");
      objectType.setProperties(Collections.singletonList(arrayProperty));

      Domain domain = new Domain();
      domain.setDomain("domain-name");
      domain.setTypes(Collections.singletonList(objectType));

      resetAll();

      expect(
              javaBuilderFactory.createClassBuilder(
                  "my.test.package.domain-name", "SomeObjectType1"))
          .andReturn(javaClassBuilder1);
      javaClassBuilder1.setJavaDoc("Description1");

      javaClassBuilder1.addPrivateField(
          "arrayPropertyName", "List<" + arrayItem.getValue() + ">", "Some property description");

      javaClassBuilder1.generateGettersAndSetters();

      javaClassBuilder1.addImport("java.util", "List");

      replayAll();

      List<Builder> builderList = builder.build(domain, TypesBuilder.NULL_DOMAIN_TYPE_RESOLVER);

      verifyAll();

      assertEquals(1, builderList.size());
      assertEquals(javaClassBuilder1, builderList.get(0));
    }
  }