@Override
    public boolean retry(final BackgroundException failure, final ProgressListener progress, final BackgroundActionState cancel) {
        if(super.retry(failure, progress, cancel)) {
            counter.recv(-counter.getRecv());
            counter.sent(-counter.getSent());
            return true;
        }
        return false;
    }
@Test
    public void testRetry() throws Exception {
        final AtomicInteger count = new AtomicInteger();
        final SegmentRetryCallable<Void> c = new SegmentRetryCallable<Void>(new Host(new TestProtocol(Scheme.file)),
            2, 0,
            new BackgroundExceptionCallable<Void>() {
                @Override
                public Void call() throws BackgroundException {
                    throw new ConnectionRefusedException("d", new SocketException());
                }
            }, new TransferStatus(), new BytecountStreamListener()) {
            @Override
            public boolean retry(final BackgroundException failure, final ProgressListener progress, final BackgroundActionState cancel) {
                count.incrementAndGet();
                return super.retry(failure, progress, cancel);
            }
        };
        try {
            c.call();
            fail();
        }
        catch(ConnectionRefusedException e) {
            // Expected
        }
        assertEquals(3, count.get());
    }