private static void verifyNextTarArchiveEntry(
      TarArchiveInputStream tarArchiveInputStream, String expectedExtractionPath, Path expectedFile)
      throws IOException {
    TarArchiveEntry header = tarArchiveInputStream.getNextTarEntry();
    assertThat(header.getName()).isEqualTo(expectedExtractionPath);

    byte[] expectedBytes = Files.readAllBytes(expectedFile);
    byte[] extractedBytes = ByteStreams.toByteArray(tarArchiveInputStream);
    assertThat(extractedBytes).isEqualTo(expectedBytes);
  }
Verifies the correctness of the next {@link TarArchiveEntry} in the {@link
TarArchiveInputStream}.

@param tarArchiveInputStream the {@link TarArchiveInputStream} to read from
@param expectedExtractionPath the expected extraction path of the next entry
@param expectedFile the file to match against the contents of the next entry
@throws IOException if an I/O exception occurs
jib-core/src/test/java/com/google/cloud/tools/jib/image/ReproducibleLayerBuilderTest.java