input = pureFactory.parse("integer(-1)"); expectedResult = new byte[]{3, 1, 7, 105, 110, 116, 101, 103, 101, 114, 1, -1, -1, -1, -1, 15}; write(input, expectedResult);
	public void testWriting() throws Exception{		// A term		ATerm input = pureFactory.parse("line(box(rect(2), square(4, 3)), circle(6))");		byte[] expectedResult = new byte[]{3, 2, 4, 108, 105, 110, 101, 3, 2, 3, 98, 111, 120, 3, 1, 4, 114, 101, 99, 116, 1, 2, 3, 2, 6, 115, 113, 117, 97, 114, 101, 1, 4, 1, 3, 3, 1, 6, 99, 105, 114, 99, 108, 101, 1, 6};		write(input, expectedResult);				// A shared term		input = pureFactory.parse("line(line(), line())");		expectedResult = new byte[]{3, 2, 4, 108, 105, 110, 101, 3, 0, 4, 108, 105, 110, 101, -128, 1};		write(input, expectedResult);				// A term with signature sharing		input = pureFactory.parse("line(line(0), line(1))");		expectedResult = new byte[]{3, 2, 4, 108, 105, 110, 101, 3, 1, 4, 108, 105, 110, 101, 1, 0, 67, 1, 1, 1};		write(input, expectedResult);				// A term with annotations		input = pureFactory.parse("line(10, 11{childAnno}){termAnno{annoOfAnno}}");		expectedResult = new byte[]{19, 2, 4, 108, 105, 110, 101, 1, 10, 17, 11, 4, 1, 3, 0, 9, 99, 104, 105, 108, 100, 65, 110, 110, 111, 4, 1, 19, 0, 8, 116, 101, 114, 109, 65, 110, 110, 111, 4, 1, 3, 0, 10, 97, 110, 110, 111, 79, 102, 65, 110, 110, 111};		write(input, expectedResult);	}