// Path: copybook4java/src/main/java/com/nordea/oss/copybook/exceptions/TypeConverterException.java
// public class TypeConverterException extends RuntimeException {
//     private static final long serialVersionUID = -7577535992947276304L;
//     public TypeConverterException(String message) {
//         super(message);
//     }
// }
// 
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/serializers/CopyBookFieldSigningType.java
// public enum CopyBookFieldSigningType {
//     POSTFIX,
//     PREFIX,
//     LAST_BYTE_BIT8,
//     LAST_BYTE_EBCDIC_BIT5
// }


import com.nordea.oss.copybook.exceptions.TypeConverterException;
import com.nordea.oss.copybook.serializers.CopyBookFieldSigningType;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import java.nio.charset.Charset;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
        config.setNullFillerChar((char)0);
        typeConverter.initialize(config);
        assertEquals(null, typeConverter.to(new byte[4], 0, 2, 2, true));
    }

    @Test
    public void testFrom() throws Exception {
        assertArrayEquals(new byte[] { (byte)192 }, typeConverter.from(0, 1, -1, true));
        assertArrayEquals(new byte[] { (byte)193 }, typeConverter.from(1, 1, -1, true));
        assertArrayEquals(new byte[] { (byte)197 }, typeConverter.from(5, 1, -1, true));
        assertArrayEquals(new byte[] { (byte)241, (byte)194 }, typeConverter.from(12, 2, -1, true));
        assertArrayEquals(new byte[] { (byte)209 }, typeConverter.from(-1, 1, -1, true));
        assertArrayEquals(new byte[] { (byte)213 }, typeConverter.from(-5, 1, -1, true));
        assertArrayEquals(new byte[] { (byte)241, (byte)210 }, typeConverter.from(-12, 2, -1, true));
    }

    @Test
    public void testFromPadding() throws Exception {
        assertArrayEquals(new byte[] { (byte)240, (byte)192 }, typeConverter.from(0, 2, -1, true));
        assertArrayEquals(new byte[] { (byte)240, (byte)193 }, typeConverter.from(1, 2, -1, true));
        assertArrayEquals(new byte[] { (byte)240, (byte)197 }, typeConverter.from(5, 2, -1, true));
        assertArrayEquals(new byte[] { (byte)240, (byte)241, (byte)194 }, typeConverter.from(12, 3, -1, true));
        assertArrayEquals(new byte[] { (byte)240, (byte)209 }, typeConverter.from(-1, 2, -1, true));
        assertArrayEquals(new byte[] { (byte)240, (byte)213 }, typeConverter.from(-5, 2, -1, true));
        assertArrayEquals(new byte[] { (byte)240, (byte)241, (byte)210 }, typeConverter.from(-12, 3, -1, true));
    }


    @Test
    public void testFromOverflow() throws Exception {
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/exceptions/TypeConverterException.java
// public class TypeConverterException extends RuntimeException {
//     private static final long serialVersionUID = -7577535992947276304L;
//     public TypeConverterException(String message) {
//         super(message);
//     }
// }
// 
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/serializers/CopyBookFieldSigningType.java
// public enum CopyBookFieldSigningType {
//     POSTFIX,
//     PREFIX,
//     LAST_BYTE_BIT8,
//     LAST_BYTE_EBCDIC_BIT5
// }


// Path: copybook4java/src/test/java/com/nordea/oss/copybook/converters/SignedIntegerToIntegerLastByteEBCDICBit5Test.java
import com.nordea.oss.copybook.exceptions.TypeConverterException;
import com.nordea.oss.copybook.serializers.CopyBookFieldSigningType;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import java.nio.charset.Charset;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;

        config.setNullFillerChar((char)0);
        typeConverter.initialize(config);
        assertEquals(null, typeConverter.to(new byte[4], 0, 2, 2, true));
    }

    @Test
    public void testFrom() throws Exception {
        assertArrayEquals(new byte[] { (byte)192 }, typeConverter.from(0, 1, -1, true));
        assertArrayEquals(new byte[] { (byte)193 }, typeConverter.from(1, 1, -1, true));
        assertArrayEquals(new byte[] { (byte)197 }, typeConverter.from(5, 1, -1, true));
        assertArrayEquals(new byte[] { (byte)241, (byte)194 }, typeConverter.from(12, 2, -1, true));
        assertArrayEquals(new byte[] { (byte)209 }, typeConverter.from(-1, 1, -1, true));
        assertArrayEquals(new byte[] { (byte)213 }, typeConverter.from(-5, 1, -1, true));
        assertArrayEquals(new byte[] { (byte)241, (byte)210 }, typeConverter.from(-12, 2, -1, true));
    }

    @Test
    public void testFromPadding() throws Exception {
        assertArrayEquals(new byte[] { (byte)240, (byte)192 }, typeConverter.from(0, 2, -1, true));
        assertArrayEquals(new byte[] { (byte)240, (byte)193 }, typeConverter.from(1, 2, -1, true));
        assertArrayEquals(new byte[] { (byte)240, (byte)197 }, typeConverter.from(5, 2, -1, true));
        assertArrayEquals(new byte[] { (byte)240, (byte)241, (byte)194 }, typeConverter.from(12, 3, -1, true));
        assertArrayEquals(new byte[] { (byte)240, (byte)209 }, typeConverter.from(-1, 2, -1, true));
        assertArrayEquals(new byte[] { (byte)240, (byte)213 }, typeConverter.from(-5, 2, -1, true));
        assertArrayEquals(new byte[] { (byte)240, (byte)241, (byte)210 }, typeConverter.from(-12, 3, -1, true));
    }


    @Test
    public void testFromOverflow() throws Exception {
        expectedEx.expect(TypeConverterException.class);