@Override
    public Long run(final Session<?> session) throws BackgroundException {
        for(Path next : files) {
            next.attributes().setSize(this.calculateSize(session, next));
        }
        return total;
    }
@Test
    public void testRun() throws Exception {
        final List<Path> files = new ArrayList<>();
        final Path a = new Path("a", EnumSet.of(Path.Type.file));
        a.attributes().setSize(1L);
        files.add(a);
        final Path b = new Path("a", EnumSet.of(Path.Type.file));
        b.attributes().setSize(3L);
        files.add(b);
        assertEquals(4L, new CalculateSizeWorker(files,
                new DisabledProgressListener()) {
            int i = 0;

            @Override
            public void cleanup(final Long result) {
                assertEquals(4L, result, 0L);
            }

            @Override
            protected void update(final long size) {
                if(0 == i) {
                    assertEquals(1L, size, 0L);
                }
                if(1 == i) {
                    assertEquals(4L, size, 0L);
                }
                i++;
            }
        }.run(new NullSession(new Host(new TestProtocol()))), 0L);
    }