### Question:
ArrayTypeInfo { public ArrayTypeInfo(QName typeName, int ranks, Integer... dimensions) { this.typeName = typeName; this.ranks = ranks; Collections.addAll(this.dimensions, dimensions); } ArrayTypeInfo(QName typeName, int ranks, Integer... dimensions);  ArrayTypeInfo(MessageReader reader, TypeMapping tm);  ArrayTypeInfo(NamespaceContext namespaceContext, String arrayTypeValue);  ArrayTypeInfo(NamespaceContext namespaceContext, String arrayTypeValue, String offsetString); QName getTypeName(); AegisType getType(); int getRanks(); List<Integer> getDimensions(); int getTotalDimensions(); int getOffset(); void writeAttribute(MessageWriter writer); String toString();  }### Answer:
@Test public void testArrayTypeInfo() throws Exception { assertEquals(new ArrayTypeInfo(new QName("", "addr"), 0, 4), "addr[4]"); assertEquals(new ArrayTypeInfo(new QName("urn:Bean", "addr", "b"), 0, 4), "b:addr[4]"); assertEquals(new ArrayTypeInfo(new QName("urn:Bean", "addr", "b"), 0, 4, 8, 9), "b:addr[4,8,9]"); assertEquals(new ArrayTypeInfo(new QName("urn:Bean", "addr", "b"), 0, 4), "b:addr[4]"); assertEquals(new ArrayTypeInfo(new QName("urn:Bean", "addr", "b"), 1, 4), "b:addr[][4]"); assertEquals(new ArrayTypeInfo(new QName("urn:Bean", "addr", "b"), 2, 4), "b:addr[,][4]"); assertEquals(new ArrayTypeInfo(new QName("urn:Bean", "addr", "b"), 4, 4), "b:addr[,,,][4]"); assertEquals(new ArrayTypeInfo(new QName("urn:Bean", "addr", "b"), 4, 4, 8, 9), "b:addr[,,,][4,8,9]"); assertInvalid("x"); assertInvalid("b:addr"); assertInvalid(":addr[4]"); assertInvalid("b:a:ddress[4]"); assertInvalid("b:addr[0]"); assertInvalid("b:addr[a]"); assertInvalid("b:addr[4,0]"); assertInvalid("b:addr[4,a]"); assertInvalid("b:addr[4,0,5]"); assertInvalid("b:addr[4,a,5]"); assertInvalid("b:addr[]"); assertInvalid("b:addr[,]"); assertInvalid("b:addr[,][]"); assertInvalid("b:addr],][4]"); assertInvalid("b:addr[,[[4]"); assertInvalid("b:addr[,]]4]"); assertInvalid("b:addr[,][4["); assertInvalid("b:addr[,][]4]"); assertInvalid("b:addr[,][][4]"); assertInvalid("b:addr[,][][4["); assertInvalid("b:addr[,][][4]end"); }