@Test
   public void testBufferSizeIncrease()
   {
      Random r = new Random();

      byte[] array = new byte[1025];
      ByteBuffer buffer = new ByteBuffer();

      for (int loop = 0; loop < array.length; loop++)
      {
         byte value = (byte) r.nextInt();
         array[loop] = value;
         buffer.add(value);
      }

      byte[] actualArray = buffer.toArray();
      assertArrayEquals(array, actualArray);
   }