@Test
  public void testSuccessfulSkip() throws Exception {
    InputStream inputStream = mock(InputStream.class);
    when(inputStream.skip(anyLong())).thenReturn(2L);
    assertEquals(10, StreamUtil.skip(inputStream, 10));
    InOrder order = inOrder(inputStream);
    order.verify(inputStream).skip(10);
    order.verify(inputStream).skip(8);
    order.verify(inputStream).skip(6);
    order.verify(inputStream).skip(4);
    order.verify(inputStream).skip(2);
    verifyNoMoreInteractions(inputStream);
  }
Verify getting a byte array from a FileInputStream.
fbcore/src/test/java/com/facebook/common/util/StreamUtilTest.java