CPUTF8 name = new CPUTF8("TestAttribute");
CPUTF8 layout = new CPUTF8("B");
MockNewAttributeBands newAttributeBands = new MockNewAttributeBands(1,
null, null, new AttributeDefinition(35,
AttributeDefinitionBands.CONTEXT_CLASS, name, layout));
newAttributeBands.addAttribute(new NewAttribute(null, "TestAttribute", "B", new byte[] {27}, null, 0, null));
newAttributeBands.addAttribute(new NewAttribute(null, "TestAttribute", "B", new byte[] {56}, null, 0, null));
newAttributeBands.addAttribute(new NewAttribute(null, "TestAttribute", "B", new byte[] {3}, null, 0, null));
ByteArrayOutputStream out = new ByteArrayOutputStream();
newAttributeBands.pack(out);
// BYTE1 is used for B layouts so we don't need to unpack to test the results
byte[] bytes = out.toByteArray();
assertEquals(3, bytes.length);