### Question:
PathElement implements Serializable { public static PathElement fromString(String s) { List<Integer> idx = new ArrayList<Integer>(); int k = s.indexOf('[', 0); if (k == -1) { return new PathElement(s, null); } String name = k > 0 ? s.substring(0, k) : null; while (true) { k = s.indexOf('[', k); if (k == -1) { break; } int k2 = s.indexOf(']', k); if (k2 == -1) { throw new IllegalArgumentException("Invalid aggregate member path '" + s + "'"); } int n = Integer.parseInt(s.substring(k + 1, k2)); if (n < 0) { throw new IllegalArgumentException("Negative array index: " + n); } idx.add(n); k = k2; } int[] idx1 = null; if (!idx.isEmpty()) { idx1 = new int[idx.size()]; for (int u = 0; u < idx.size(); u++) { idx1[u] = idx.get(u); } } return new PathElement(name, idx1); } PathElement(String name, int[] index); String toString(); static PathElement fromString(String s); String getName(); int[] getIndex(); static String pathToString(PathElement[] path);  }### Answer:
@Test public void test1() { PathElement pe = PathElement.fromString("aa[1][2][3]"); assertEquals("aa", pe.name); assertArrayEquals(new int[] {1, 2, 3}, pe.index); }
@Test public void test2() { PathElement pe = PathElement.fromString("abc"); assertEquals("abc", pe.name); assertNull(pe.index); }
@Test public void test3() { IntegerParameterType.Builder intTypeb = new IntegerParameterType.Builder(); intTypeb.setName("m1type"); AggregateParameterType.Builder aggType = new AggregateParameterType.Builder(); aggType.setName("aggType"); Member m1 = new Member("m1"); IntegerParameterType intType = intTypeb.build(); m1.setDataType(intType); aggType.addMember(m1); ArrayParameterType.Builder arrayType = new ArrayParameterType.Builder(); arrayType.setName("test"); arrayType.setNumberOfDimensions(1); arrayType.setElementType(aggType.build()); PathElement[] path = new PathElement[] {PathElement.fromString("[3]"), PathElement.fromString("m1")}; DataType dt = DataTypeUtil.getMemberType(arrayType.build(), path); assertEquals(intType, dt); }