DataConverter extends com.tngtech.junit.dataprovider.convert.DataConverter { public boolean canConvert(Type type) { if (type instanceof Class) { return Object[][].class.equals(type) || Object[].class.equals(type) || String[].class.equals(type); } if (type instanceof ParameterizedType) { ParameterizedType parameterizedType = (ParameterizedType) type; Type rawType = parameterizedType.getRawType(); if (Iterable.class.isAssignableFrom((Class<?>) rawType)) { return canConvertIterableOf(parameterizedType); } } return false; } DataConverter(); boolean canConvert(Type type); List<Object[]> convert(Object data, boolean isVarargs, Class<?>[] parameterTypes, DataProvider dataProvider); void setObjectArrayConverter(ObjectArrayConverter objectArrayConverter); void setSingleArgConverter(SingleArgConverter singleArgConverter); void setStringConverter(StringConverter stringConverter);  }
@Test public void testCanConvertShouldReturnFalseIfTypeIsNull() { boolean result = underTest.canConvert(null); assertThat(result).isFalse(); }
@Test public void testCanConvertShouldReturnFalseIfTypeIsObject() { boolean result = underTest.canConvert(Object.class); assertThat(result).isFalse(); }
@Test public void testCanConvertShouldReturnFalseIfTypeIsString() { boolean result = underTest.canConvert(String.class); assertThat(result).isFalse(); }
@Test public void testCanConvertShouldReturnFalseIfTypeIsList() { Type type = List.class; boolean result = underTest.canConvert(type); assertThat(result).isFalse(); }
@Test public void testCanConvertShouldReturnTrueIfTypeIsListOfObject() { Type type = getMethod("methodReturningListOfObject").getGenericReturnType(); boolean result = underTest.canConvert(type); assertThat(result).isTrue(); }
@Test public void testCanConvertShouldReturnTrueIfTypeIsIterableOfWildcard() { Type type = getMethod("methodReturningIterableOfWildcard").getGenericReturnType(); boolean result = underTest.canConvert(type); assertThat(result).isTrue(); }
@Test public void testCanConvertShouldReturnTrueIfTypeIsListOfWildcard() { Type type = getMethod("methodReturningListOfWildcard").getGenericReturnType(); boolean result = underTest.canConvert(type); assertThat(result).isTrue(); }
@Test public void testCanConvertShouldReturnTrueIfTypeIsIterableOfIterable() { Type type = getMethod("methodReturningIterableOfIterableOfT").getGenericReturnType(); boolean result = underTest.canConvert(type); assertThat(result).isTrue(); }
@Test public void testCanConvertShouldReturnTrueIfTypeIsSetOfSet() { Type type = getMethod("methodReturningSetOfSetOfWildcard").getGenericReturnType(); boolean result = underTest.canConvert(type); assertThat(result).isTrue(); }
@Test public void testCanConvertShouldReturnFalseIfTypeIsTwoArgList() { Type type = getMethod("methodReturningTwoArgListOfListsOfObject").getGenericReturnType(); boolean result = underTest.canConvert(type); assertThat(result).isFalse(); }
@Test public void testCanConvertShouldReturnTrueIfTypeIsObjectArrayArray() { Type type = getMethod("methodReturningObjectArrayArray").getGenericReturnType(); boolean result = underTest.canConvert(type); assertThat(result).isTrue(); }
@Test public void testCanConvertShouldReturnTrueIfTypeIsObjectArray() { Type type = getMethod("methodReturningObjectArray").getGenericReturnType(); boolean result = underTest.canConvert(type); assertThat(result).isTrue(); }
@Test public void testCanConvertShouldReturnTrueIfTypeIsStringArray() { Type type = getMethod("methodReturningStringArray").getGenericReturnType(); boolean result = underTest.canConvert(type); assertThat(result).isTrue(); }
@Test public void testCanConvertShouldReturnTrueIfTypeIsListOfListOfObject() { Type type = getMethod("methodReturningListOfListOfObject").getGenericReturnType(); boolean result = underTest.canConvert(type); assertThat(result).isTrue(); }
@Test public void testCanConvertShouldReturnTrueIfTypeIsListOfListOfWildcard() { Type type = getMethod("methodReturningListOfListOfWildcard").getGenericReturnType(); boolean result = underTest.canConvert(type); assertThat(result).isTrue(); }
@Test public void testCanConvertShouldReturnTrueIfTypeIsListOfIterable() { Type type = getMethod("methodReturningListOfIterableOfNumber").getGenericReturnType(); boolean result = underTest.canConvert(type); assertThat(result).isTrue(); }
@Test public void testCanConvertShouldReturnTrueIfTypeIsSubListSubListObject() { Type type = getMethod("methodReturningSubListOfSubListOfObject").getGenericReturnType(); boolean result = underTest.canConvert(type); assertThat(result).isTrue(); }