### Question:
Utils { public static String getArrayDimensionString(Object array) { if (!array.getClass().isArray()) { return ""; } StringBuilder sb = new StringBuilder(); Object current = array; int len = Array.getLength(current); sb.append('[').append(len).append(']'); while (len > 0) { current = Array.get(current, 0); if ((current == null) || !current.getClass().isArray()) { break; } len = Array.getLength(current); sb.append('[').append(len).append(']'); } return sb.toString(); }  static Object buildArray(String internalName, int length); static Object buildArray(String internalName, int length, ClassLoader classLoader); static List<String> builderTypeListToTypeNames(BuilderTypeList typeList); static String buildFieldDescriptor(Field field); static Object castToPrimitive(Object value, String targetType); static String getArrayDimensionString(Object array); static Double getDoubleValue(Object obj); static List<File> getFilesWithSmaliExtension(File file); static Float getFloatValue(Object obj); static Integer getIntegerValue(Object obj); static MethodLocation[] getLocations(BuilderInstruction... instructions); static Long getLongValue(Object obj); static MethodLocation getNextLocation(MethodLocation location, TIntObjectMap<MethodLocation> addressToLocation); static List<String> getParameterTypes(String methodDescriptor); static int getRegisterSize(BuilderTypeList typeList); static int getRegisterSize(Class<?>[] parameterTypes); static int getRegisterSize(List<String> typeNames); static int getRegisterSize(String typeName); static Set<String> getDeclaredAndValueTypeNames(HeapItem item); static void shiftIntegerMapKeys(int startKey, int shift, TIntObjectMap<T> intToObject);  }### Answer:
@Test public void getArrayDimensionStringWithNonArrayObjectReturnsEmptyString() { String value = "some string"; String expected = ""; String actual = Utils.getArrayDimensionString(value); assertEquals(expected, actual); }
@Test public void getArrayDimensionStringWith1DArrayReturnsExpected() { int[] value = new int[5]; String expected = "[5]"; String actual = Utils.getArrayDimensionString(value); assertEquals(expected, actual); }
@Test public void getArrayDimensionStringWith3DArrayReturnsExpected() { String[][][] value = new String[5][4][3]; String expected = "[5][4][3]"; String actual = Utils.getArrayDimensionString(value); assertEquals(expected, actual); }