@Override
    public AttributedList<Path> list(final Path directory, final ListProgressListener listener) throws BackgroundException {
        return this.list(directory, listener, new HostPreferences(session.getHost()).getInteger("brick.listing.chunksize"));
    }
@Test
    public void testListEqualChunkSize() throws Exception {
        final Path directory = new BrickDirectoryFeature(session).mkdir(new Path(new AlphanumericRandomStringService().random(), EnumSet.of(AbstractPath.Type.directory)), new TransferStatus());
        final Path f1 = new BrickTouchFeature(session).touch(new Path(directory, new AlphanumericRandomStringService().random(), EnumSet.of(AbstractPath.Type.file)), new TransferStatus());
        final Path f2 = new BrickTouchFeature(session).touch(new Path(directory, new AlphanumericRandomStringService().random(), EnumSet.of(AbstractPath.Type.file)), new TransferStatus());
        final AttributedList<Path> list = new BrickListService(session).list(directory, new DisabledListProgressListener(), 2);
        assertNotSame(AttributedList.emptyList(), list);
        assertFalse(list.isEmpty());
        assertEquals(2, list.size());
        for(Path f : list) {
            assertSame(directory, f.getParent());
        }
        assertTrue(list.contains(f1));
        assertTrue(list.contains(f2));
        new BrickDeleteFeature(session).delete(Collections.singletonList(directory), new DisabledPasswordCallback(), new Delete.DisabledCallback());
    }