  @Test
  public void testEmptyArray() throws java.io.IOException {

    ArrayInputStream stream = new ArrayInputStream(ByteBuffer.allocate(0));
    ByteBuffer dst = ByteBuffer.allocate(10);

    // read() should return -1 at the end of the stream
    // https://docs.oracle.com/javase/7/docs/api/java/nio/channels/ReadableByteChannel.html
    Assert.assertEquals(stream.read(dst), -1);
  }