@Test
  public void toByteArray_returnsBytes() {
    int count = 0;
    byte[][] array = new byte[10][5];
    for (int i = 0; i < array.length; i++) {
      for (int j = 0; j < array[i].length; j++) {
        array[i][j] = (byte) ++count;
      }
    }
    assertThat(count).isEqualTo(50);

    count = 0;
    Byte[][] byteArray = toByteArray(array);
    for (final Byte[] bytes : byteArray) {
      for (int j = 0; j < bytes.length; j++) {
        assertThat(bytes[j].byteValue()).isEqualTo((byte) ++count);
      }
    }
    assertThat(count).isEqualTo(50);
  }
Unit tests for {@link ArrayUtils}.

@since GemFire 7.x
geode-core/src/test/java/org/apache/geode/internal/util/ArrayUtilsTest.java