### Question:
LZMAInputStream extends InputStream implements Runnable { @Override public long skip(long n) throws IOException { checkStream(); try { return uncompressedPipeIn.skip(n); } catch(IOException e) { if(getDecompressionComplete()) { return -1; } throw e; } } LZMAInputStream(InputStream compressedStream);  LZMAInputStream(InputStream compressedStream, int bufferSize); @Override int read(); @Override int available(); @Override void close(); @Override boolean markSupported(); @Override int read(byte[] b, int off, int len); @Override int read(byte[] b); @Override long skip(long n); @Override void run();  }### Answer:
@Test public void testSkip() throws Exception { InputStream decompressed = new LZMAInputStream(compressedData); int in1, in2; long offset = 0; while((in1 = uncompressedData.read()) != -1) { in2 = decompressed.read(); assertEquals("Mismatch at offset " + offset, in1, in2); long offset1 = uncompressedData.skip(7); long offset2 = decompressed.skip(7); assertEquals("Skipped bytes mismatch at offset " + offset, offset1, offset2); offset += offset1 + 1; } in2 = decompressed.read(); assertEquals("Mismatch at EOF", -1, in2); decompressed.close(); uncompressedData.close(); }