@Override
    public Long run(final Session<?> session) throws BackgroundException {
        for(Path next : files) {
            if(this.isCanceled()) {
                throw new ConnectionCanceledException();
            }
            if(TransferStatus.UNKNOWN_LENGTH == next.attributes().getSize()) {
                continue;
            }
            total += next.attributes().getSize();
        }
        return total;
    }
@Test
    public void testRun() throws Exception {
        final Path d = new Path("/d", EnumSet.of(Path.Type.directory));
        d.attributes().setSize(-1L);
        final ReadSizeWorker worker = new ReadSizeWorker(Collections.singletonList(d)) {
            @Override
            public void cleanup(final Long result) {
                //
            }
        };
        assertEquals(0L, worker.run(new NullSession(new Host(new TestProtocol()))), 0L);
    }