public static ByteBuffer getIncreasingByteBuffer(int len) {
    return getIncreasingByteBuffer(0, len);
  }
@Test
  public void getIncreasingByteBuffer() {
    class TestCase {
      ByteBuffer mExpected;
      int mLength;
      int mStart;

      public TestCase(ByteBuffer expected, int length, int start) {
        mExpected = expected;
        mLength = length;
        mStart = start;
      }
    }

    ArrayList<TestCase> testCases = new ArrayList<>();
    testCases.add(new TestCase(ByteBuffer.wrap(new byte[] {}), 0, 0));
    testCases.add(new TestCase(ByteBuffer.wrap(new byte[] {}), 0, 3));
    testCases.add(new TestCase(ByteBuffer.wrap(new byte[] {0}), 1, 0));
    testCases.add(new TestCase(ByteBuffer.wrap(new byte[] {0, 1, 2}), 3, 0));
    testCases.add(new TestCase(ByteBuffer.wrap(new byte[] {3}), 1, 3));
    testCases.add(new TestCase(ByteBuffer.wrap(new byte[] {3, 4, 5}), 3, 3));

    for (TestCase testCase : testCases) {
      ByteBuffer result = BufferUtils.getIncreasingByteBuffer(testCase.mStart, testCase.mLength);
      assertEquals(testCase.mExpected.capacity(), result.capacity());
      for (int k = 0; k < result.capacity(); k++) {
        assertEquals(testCase.mExpected.get(k), result.get(k));
      }
    }
  }