ConvertUtil { public static Object convertPrimitiveArrayToList(Object value) { if (value == null) { return value; } Class<?> type = value.getClass().getComponentType(); if (type == null) { return value; } if (!type.isPrimitive()) { return value; } List<Object> list = new ArrayList<Object>(); if (value instanceof boolean[]) { for (boolean data : (boolean[]) value) { list.add(data); } } else if (value instanceof byte[]) { for (byte data : (byte[]) value) { list.add(Byte.toString(data)); } } else if (value instanceof char[]) { for (char data : (char[]) value) { list.add(Character.toString(data)); } } else if (value instanceof double[]) { for (double data : (double[]) value) { list.add(Double.toString(data)); } } else if (value instanceof float[]) { for (float data : (float[]) value) { list.add(Float.toString(data)); } } else if (value instanceof int[]) { for (int data : (int[]) value) { list.add(Integer.toString(data)); } } else if (value instanceof long[]) { for (long data : (long[]) value) { list.add(Long.toString(data)); } } else if (value instanceof short[]) { for (short data : (short[]) value) { list.add(Short.toString(data)); } } return list; }  static Object[] toArray(Object obj); @SuppressWarnings("unchecked") static List<E> toList(Object obj, Class<E> elementClass); static T convert(Object obj, Class<T> clazz); static T convertIfNotNull(Object obj, Class<T> clazz); @SuppressWarnings("unchecked") static T convert(
            Object obj, Class<T> clazz, boolean allowsNull); static Object convertPrimitiveArrayToList(Object value); @SuppressWarnings("unchecked") static List<Map<String, Object>> toListOfMap(Object obj); static final String CLASS_FIELDNAME; }
@Test public void testConvertPrimitiveArrayToList01() throws Exception { assertNull(ConvertUtil.convertPrimitiveArrayToList(null)); }
@Test public void testConvertPrimitiveArrayToList02() throws Exception { Object result = ConvertUtil.convertPrimitiveArrayToList(""); assertNotNull(result); assertEquals("", result); }
@Test public void testConvertPrimitiveArrayToList03() throws Exception { Object result = ConvertUtil.convertPrimitiveArrayToList(" "); assertNotNull(result); assertEquals(" ", result); }
@Test public void testConvertPrimitiveArrayToList04() throws Exception { Object result = ConvertUtil.convertPrimitiveArrayToList("noarray"); assertNotNull(result); assertEquals("noarray", result); }
@Test public void testConvertPrimitiveArrayToList05() throws Exception { Object[] value = new Object[0]; Object result = ConvertUtil.convertPrimitiveArrayToList(value); assertNotNull(result); assertTrue(result instanceof Object[]); Object[] arrayResult = (Object[]) result; assertEquals(0, arrayResult.length); }
@Test public void testConvertPrimitiveArrayToList06() throws Exception { Object[] value = { "foo" }; Object result = ConvertUtil.convertPrimitiveArrayToList(value); assertNotNull(result); assertTrue(result instanceof Object[]); Object[] arrayResult = (Object[]) result; assertEquals(1, arrayResult.length); assertEquals("foo", arrayResult[0]); }
@Test public void testConvertPrimitiveArrayToList07() throws Exception { Object[] value = { "foo", "bar", "baz" }; Object result = ConvertUtil.convertPrimitiveArrayToList(value); assertNotNull(result); assertTrue(result instanceof Object[]); Object[] arrayResult = (Object[]) result; assertEquals(3, arrayResult.length); assertEquals("foo", arrayResult[0]); assertEquals("bar", arrayResult[1]); assertEquals("baz", arrayResult[2]); }
@Test public void testConvertPrimitiveArrayToList08() throws Exception { boolean[] value = new boolean[0]; Object result = ConvertUtil.convertPrimitiveArrayToList(value); assertNotNull(result); assertTrue(result instanceof List); List<?> listResult = (List<?>) result; assertEquals(0, listResult.size()); }
@Test public void testConvertPrimitiveArrayToList09() throws Exception { boolean[] value = { true }; Object result = ConvertUtil.convertPrimitiveArrayToList(value); assertNotNull(result); assertTrue(result instanceof List); List<?> listResult = (List<?>) result; assertEquals(1, listResult.size()); assertTrue((Boolean) listResult.get(0)); }
@Test public void testConvertPrimitiveArrayToList10() throws Exception { boolean[] value = { true, false, true }; Object result = ConvertUtil.convertPrimitiveArrayToList(value); assertNotNull(result); assertTrue(result instanceof List); List<?> listResult = (List<?>) result; assertEquals(3, listResult.size()); assertTrue((Boolean) listResult.get(0)); assertFalse((Boolean) listResult.get(1)); assertTrue((Boolean) listResult.get(2)); }
@Test public void testConvertPrimitiveArrayToList11() throws Exception { byte[] value = new byte[0]; Object result = ConvertUtil.convertPrimitiveArrayToList(value); assertNotNull(result); assertTrue(result instanceof List); List<?> listResult = (List<?>) result; assertEquals(0, listResult.size()); }
@Test public void testConvertPrimitiveArrayToList12() throws Exception { byte[] value = { 1 }; Object result = ConvertUtil.convertPrimitiveArrayToList(value); assertNotNull(result); assertTrue(result instanceof List); List<?> listResult = (List<?>) result; assertEquals(1, listResult.size()); assertEquals("1", listResult.get(0)); }
@Test public void testConvertPrimitiveArrayToList13() throws Exception { byte[] value = { 1, 2, 3 }; Object result = ConvertUtil.convertPrimitiveArrayToList(value); assertNotNull(result); assertTrue(result instanceof List); List<?> listResult = (List<?>) result; assertEquals(3, listResult.size()); assertEquals("1", listResult.get(0)); assertEquals("2", listResult.get(1)); assertEquals("3", listResult.get(2)); }
@Test public void testConvertPrimitiveArrayToList14() throws Exception { char[] value = new char[0]; Object result = ConvertUtil.convertPrimitiveArrayToList(value); assertNotNull(result); assertTrue(result instanceof List); List<?> listResult = (List<?>) result; assertEquals(0, listResult.size()); }
@Test public void testConvertPrimitiveArrayToList15() throws Exception { char[] value = { 'A' }; Object result = ConvertUtil.convertPrimitiveArrayToList(value); assertNotNull(result); assertTrue(result instanceof List); List<?> listResult = (List<?>) result; assertEquals(1, listResult.size()); assertEquals("A", listResult.get(0)); }
@Test public void testConvertPrimitiveArrayToList16() throws Exception { char[] value = { 'A', 'B', 'C' }; Object result = ConvertUtil.convertPrimitiveArrayToList(value); assertNotNull(result); assertTrue(result instanceof List); List<?> listResult = (List<?>) result; assertEquals(3, listResult.size()); assertEquals("A", listResult.get(0)); assertEquals("B", listResult.get(1)); assertEquals("C", listResult.get(2)); }
@Test public void testConvertPrimitiveArrayToList17() throws Exception { double[] value = new double[0]; Object result = ConvertUtil.convertPrimitiveArrayToList(value); assertNotNull(result); assertTrue(result instanceof List); List<?> listResult = (List<?>) result; assertEquals(0, listResult.size()); }
@Test public void testConvertPrimitiveArrayToList18() throws Exception { double[] value = { 123.456 }; Object result = ConvertUtil.convertPrimitiveArrayToList(value); assertNotNull(result); assertTrue(result instanceof List); List<?> listResult = (List<?>) result; assertEquals(1, listResult.size()); assertEquals("123.456", listResult.get(0)); }
@Test public void testConvertPrimitiveArrayToList19() throws Exception { double[] value = { 123.456, 12.34, 1.2 }; Object result = ConvertUtil.convertPrimitiveArrayToList(value); assertNotNull(result); assertTrue(result instanceof List); List<?> listResult = (List<?>) result; assertEquals(3, listResult.size()); assertEquals("123.456", listResult.get(0)); assertEquals("12.34", listResult.get(1)); assertEquals("1.2", listResult.get(2)); }
@Test public void testConvertPrimitiveArrayToList20() throws Exception { float[] value = new float[0]; Object result = ConvertUtil.convertPrimitiveArrayToList(value); assertNotNull(result); assertTrue(result instanceof List); List<?> listResult = (List<?>) result; assertEquals(0, listResult.size()); }
@Test public void testConvertPrimitiveArrayToList21() throws Exception { float[] value = { 12.3F }; Object result = ConvertUtil.convertPrimitiveArrayToList(value); assertNotNull(result); assertTrue(result instanceof List); List<?> listResult = (List<?>) result; assertEquals(1, listResult.size()); assertEquals("12.3", listResult.get(0)); }
@Test public void testConvertPrimitiveArrayToList22() throws Exception { float[] value = { 12.3F, 1.2F, 1F }; Object result = ConvertUtil.convertPrimitiveArrayToList(value); assertNotNull(result); assertTrue(result instanceof List); List<?> listResult = (List<?>) result; assertEquals(3, listResult.size()); assertEquals("12.3", listResult.get(0)); assertEquals("1.2", listResult.get(1)); assertEquals("1.0", listResult.get(2)); }
@Test public void testConvertPrimitiveArrayToList23() throws Exception { int[] value = new int[0]; Object result = ConvertUtil.convertPrimitiveArrayToList(value); assertNotNull(result); assertTrue(result instanceof List); List<?> listResult = (List<?>) result; assertEquals(0, listResult.size()); }
@Test public void testConvertPrimitiveArrayToList24() throws Exception { int[] value = { 1 }; Object result = ConvertUtil.convertPrimitiveArrayToList(value); assertNotNull(result); assertTrue(result instanceof List); List<?> listResult = (List<?>) result; assertEquals(1, listResult.size()); assertEquals("1", listResult.get(0)); }
@Test public void testConvertPrimitiveArrayToList25() throws Exception { int[] value = { 1, 2, 3 }; Object result = ConvertUtil.convertPrimitiveArrayToList(value); assertNotNull(result); assertTrue(result instanceof List); List<?> listResult = (List<?>) result; assertEquals(3, listResult.size()); assertEquals("1", listResult.get(0)); assertEquals("2", listResult.get(1)); assertEquals("3", listResult.get(2)); }
@Test public void testConvertPrimitiveArrayToList26() throws Exception { long[] value = new long[0]; Object result = ConvertUtil.convertPrimitiveArrayToList(value); assertNotNull(result); assertTrue(result instanceof List); List<?> listResult = (List<?>) result; assertEquals(0, listResult.size()); }
@Test public void testConvertPrimitiveArrayToList27() throws Exception { long[] value = { 1L }; Object result = ConvertUtil.convertPrimitiveArrayToList(value); assertNotNull(result); assertTrue(result instanceof List); List<?> listResult = (List<?>) result; assertEquals(1, listResult.size()); assertEquals("1", listResult.get(0)); }
@Test public void testConvertPrimitiveArrayToList28() throws Exception { long[] value = { 1L, 2L, 3L }; Object result = ConvertUtil.convertPrimitiveArrayToList(value); assertNotNull(result); assertTrue(result instanceof List); List<?> listResult = (List<?>) result; assertEquals(3, listResult.size()); assertEquals("1", listResult.get(0)); assertEquals("2", listResult.get(1)); assertEquals("3", listResult.get(2)); }
@Test public void testConvertPrimitiveArrayToList29() throws Exception { short[] value = new short[0]; Object result = ConvertUtil.convertPrimitiveArrayToList(value); assertNotNull(result); assertTrue(result instanceof List); List<?> listResult = (List<?>) result; assertEquals(0, listResult.size()); }
@Test public void testConvertPrimitiveArrayToList30() throws Exception { short[] value = { (short) 1 }; Object result = ConvertUtil.convertPrimitiveArrayToList(value); assertNotNull(result); assertTrue(result instanceof List); List<?> listResult = (List<?>) result; assertEquals(1, listResult.size()); }
@Test public void testConvertPrimitiveArrayToList31() throws Exception { short[] value = { (short) 1, (short) 2, (short) 3 }; Object result = ConvertUtil.convertPrimitiveArrayToList(value); assertNotNull(result); assertTrue(result instanceof List); List<?> listResult = (List<?>) result; assertEquals(3, listResult.size()); assertEquals("1", listResult.get(0)); assertEquals("2", listResult.get(1)); assertEquals("3", listResult.get(2)); }