private static byte[] eTrue = new byte[] { 0x01, 0x01, (byte) 0xFF };
public void test_Decode_Encode() throws IOException {
// oid decoder/encoder for testing
ASN1Boolean asn1 = ASN1Boolean.getInstance();
// decoding false
DerInputStream in = new DerInputStream(eFalse);
assertEquals("Decoding false value", Boolean.FALSE, asn1.decode(in));
// decoding true
in = new DerInputStream(eTrue);
assertEquals("Decoding true value", Boolean.TRUE, asn1.decode(in));
// encoding false
DerOutputStream out = new DerOutputStream(asn1, Boolean.FALSE);
assertTrue("Encoding false value", Arrays.equals(eFalse, out.encoded));