### Question:
ArrayUtils { public static String objectToString(final Object invalidValue) { if (invalidValue == null) { return null; } if (invalidValue.getClass().isArray()) { if (invalidValue instanceof Object[]) { return Arrays.toString((Object[]) invalidValue); } else if (invalidValue instanceof boolean[]) { return Arrays.toString((boolean[]) invalidValue); } else if (invalidValue instanceof byte[]) { return Arrays.toString((byte[]) invalidValue); } else if (invalidValue instanceof char[]) { return Arrays.toString((char[]) invalidValue); } else if (invalidValue instanceof double[]) { return Arrays.toString((double[]) invalidValue); } else if (invalidValue instanceof float[]) { return Arrays.toString((float[]) invalidValue); } else if (invalidValue instanceof int[]) { return Arrays.toString((int[]) invalidValue); } else if (invalidValue instanceof long[]) { return Arrays.toString((long[]) invalidValue); } else if (invalidValue instanceof short[]) { return Arrays.toString((short[]) invalidValue); } } return invalidValue.toString(); }  static String objectToString(final Object invalidValue); static String[] objArrayToStringArray(final Object... objArray); static boolean checkArraysLength(Object[] first, Object[] second);  }### Answer:
@Test public void objectToString_nullValue_returnNull() { assertNull(objectToString(null)); }
@Test public void objectToString_objectArray_returnStr() { Object[] arrays = new Object[] {new SomeObj("test_1"), new SomeObj("test_2"), new SomeObj("test_3")}; assertEquals("[test_1, test_2, test_3]", objectToString(arrays)); }
@Test public void objectToString_objectArrayWithNullValue_returnStr() { Object[] arrays = new Object[] {new SomeObj("test_1"), new SomeObj("test_2"), null}; assertEquals("[test_1, test_2, null]", objectToString(arrays)); }
@Test public void objectToString_collectionOfObjects_returnStr() { Collection<SomeObj> collection = new ArrayList<SomeObj>(Arrays.asList(new SomeObj("test_1"), new SomeObj("test_2"), new SomeObj("test_3"))); assertEquals("[test_1, test_2, test_3]", objectToString(collection)); }
@Test public void objectToString_booleanArray_returnStr() { boolean[] arrays = new boolean[] {true, false, true}; assertEquals("[true, false, true]", objectToString(arrays)); }
@Test public void objectToString_byteArray_returnStr() { byte[] arrays = new byte[] {1, 2, 3}; assertEquals("[1, 2, 3]", objectToString(arrays)); }
@Test public void objectToString_charArray_returnStr() { char[] arrays = new char[] {'a', '1', 'b'}; assertEquals("[a, 1, b]", objectToString(arrays)); }
@Test public void objectToString_doubleArray_returnStr() { double[] arrays = new double[] {1.0, 2.1, 3.01}; assertEquals("[1.0, 2.1, 3.01]", objectToString(arrays)); }
@Test public void objectToString_floatArray_returnStr() { float[] arrays = new float[] {1.0f, 2.1f, 3.01f}; assertEquals("[1.0, 2.1, 3.01]", objectToString(arrays)); }
@Test public void objectToString_intArray_returnStr() { int[] arrays = new int[] {1, 2, 3}; assertEquals("[1, 2, 3]", objectToString(arrays)); }
@Test public void objectToString_longArray_returnStr() { long[] arrays = new long[] {1, 2, 3}; assertEquals("[1, 2, 3]", objectToString(arrays)); }
@Test public void objectToString_shortArray_returnStr() { short[] arrays = new short[] {1, 2, 3}; assertEquals("[1, 2, 3]", objectToString(arrays)); }
@Test public void objectToString_someObject_returnStr() { SomeObj someObj = new SomeObj("test"); assertEquals("test", objectToString(someObj)); }