### Question:
SdkFilterInputStream extends FilterInputStream implements MetricAware { protected final void abortIfNeeded() { if (Thread.interrupted()) { abort(); throw new AbortedException(); } } protected  SdkFilterInputStream(InputStream in); @Override @Deprecated boolean isMetricActivated(); @Override int read(); @Override int read(byte b[], int off, int len); @Override long skip(long n); @Override int available(); @Override void close(); @Override synchronized void mark(int readlimit); @Override synchronized void reset(); @Override boolean markSupported();  }### Answer:
@Test public void testShouldAbort() throws InterruptedException { final List<Integer> abortionCount = new ArrayList<Integer>(); Thread t = new Thread(new Runnable() { @Override public void run() { ByteArrayInputStream bais = new ByteArrayInputStream( "Content".getBytes(StringUtils.UTF8)); TestInputStream tis = new TestInputStream(bais); long counter = 0; while (counter < Long.MAX_VALUE) { counter++; if (Thread.currentThread().isInterrupted()) { try { tis.abortIfNeeded(); } catch (AbortedException e) { } abortionCount.add(tis.getAbortions()); break; } } } }); t.start(); Thread.sleep(1000); t.interrupt(); Thread.sleep(1000); assertEquals(abortionCount.size(), 1); assertEquals(abortionCount.get(0), new Integer(1)); }