//FIXME need testcase for decoding invalid encodings
public void testEncode() throws IOException {
for (int i = 0; i < testcases.length; i++) {
DerOutputStream out = new DerOutputStream(choice, testcases[i][0]);
assertTrue("Test case: " + i, Arrays.equals(
(byte[]) testcases[i][1], out.encoded));
}
}