@Test
public void shouldHavBZip2CompatibleOutput() throws IOException {

  BZip2Compressor<String> compressor = new BZip2Compressor<>(String::getBytes);
  String origString = "somestring";
  try (ByteArrayInputStream inputStream =
          new ByteArrayInputStream(compressor.compress(origString));
      BZip2CompressorInputStream bzip2Input = new BZip2CompressorInputStream(inputStream);
      BufferedReader reader = new BufferedReader(new InputStreamReader(bzip2Input))) {
    Assert.assertEquals(origString, reader.readLine());
  }
}