StringToBoolean extends StringToString { @Override public byte[] from(Object value, int length, int decimals, boolean addPadding) { return super.from(value != null ? ((boolean)value ? values[0] : values[1]) : null, length, decimals, addPadding); }  @Override void initialize(TypeConverterConfig config); @Override void validate(Class<?> type, int size, int decimals); @Override Object to(byte[] bytes, int offset, int length, int decimals, boolean removePadding); @Override byte[] from(Object value, int length, int decimals, boolean addPadding);  }
@Test public void testFrom() throws Exception { assertArrayEquals("Y".getBytes(StandardCharsets.UTF_8), typeConverter.from(true, 1, -1, true)); assertArrayEquals("N".getBytes(StandardCharsets.UTF_8), typeConverter.from(false, 1, -1, true)); }