public class BooleanArrayConverterTest {
@Test
public void testConversion() {
BooleanArrayConverter booleanArrayConverter = (BooleanArrayConverter) TypeConverterManager.lookup(boolean[].class);
assertNull(booleanArrayConverter.convert(null));
boolean[] primitiveArray = new boolean[]{false, true, false};
Object convertedArray = booleanArrayConverter.convert(primitiveArray);
assertEquals(boolean[].class, convertedArray.getClass());
Boolean[] booleanArray = new Boolean[]{Boolean.FALSE, Boolean.TRUE, Boolean.FALSE};
convertedArray = booleanArrayConverter.convert(booleanArray);
assertEquals(boolean[].class, convertedArray.getClass()); // boolean[]!
assertEq(arrl(true), booleanArrayConverter.convert(Boolean.TRUE));
assertEq(arrl(true), booleanArrayConverter.convert("true"));
assertEq(arrl(true, false, true), booleanArrayConverter.convert(arrl(true, false, true)));
assertEq(arrl(true, false, true), booleanArrayConverter.convert(arri(-7, 0, 3)));
assertEq(arrl(true, false, true), booleanArrayConverter.convert(arrf(-7.0f, 0.0f, 3.0f)));
assertEq(arrl(true, false, true), booleanArrayConverter.convert(arrs("true", "0", "yes")));
assertEq(arrl(true, false, true), booleanArrayConverter.convert(arrs(" true ", "0", " yes ")));
assertEq(arrl(true, false, true), booleanArrayConverter.convert(" true , 0, yes "));
}