VariableHelper { static byte[] getByteVector(int length, byte fillValue) { final byte[] vector = new byte[length]; if (fillValue != (byte) 0) { Arrays.fill(vector, fillValue); } return vector; }    }
@Test public void testGetFilledVector_bytes_filled() { final byte[] byteVector = VariableHelper.getByteVector(16, (byte)107); assertEquals(16, byteVector.length); for (final byte value : byteVector) { assertEquals((byte)107, value); } }
@Test public void testGetFilledVector_bytes_unfilled() { final byte[] byteVector = VariableHelper.getByteVector(15, (byte)0); assertEquals(15, byteVector.length); for (final byte value : byteVector) { assertEquals((byte)0, value); } }