@@ -0,0 +1,2047 @@
+package peergos.server.tests;%0A%0Aimport org.junit.*;%0Aimport peergos.server.*;%0Aimport peergos.server.storage.*;%0Aimport peergos.shared.*;%0Aimport peergos.shared.crypto.*;%0Aimport peergos.shared.crypto.symmetric.*;%0Aimport peergos.shared.user.fs.*;%0Aimport peergos.shared.user.fs.cryptree.*;%0A%0Aimport java.time.*;%0Aimport java.util.*;%0Aimport java.util.stream.*;%0A%0Apublic class BlockSizeTests %7B%0A    private static Crypto crypto = Main.initCrypto();%0A%0A    @Test%0A    public void largeDirectoryCryptreeNode() %7B%0A        SymmetricKey rBase = SymmetricKey.random();%0A        SymmetricKey wBase = SymmetricKey.random();%0A        SymmetricKey parent = SymmetricKey.random();%0A        SymmetricKey parentParent = SymmetricKey.random();%0A        FileProperties props = new FileProperties(%22a-directory%22, true, false, %22%22, 0, 0,%0A                LocalDateTime.now(), false, Optional.empty(), Optional.empty());%0A        SigningPrivateKeyAndPublicHash signingPair = ChampTests.createUser(new RAMStorage(), crypto);%0A%0A        Optional%3CRelativeCapability%3E parentCap = Optional.of(new RelativeCapability(Optional.empty(), crypto.random.randomBytes(32), parentParent, Optional.empty()));%0A        RelativeCapability nextChunk = new RelativeCapability(Optional.empty(), crypto.random.randomBytes(32), parentParent, Optional.empty());%0A%0A        String nameBase = IntStream.range(0, 252).mapToObj(i -%3E %22A%22).collect(Collectors.joining());%0A        List%3CNamedRelativeCapability%3E children = IntStream.range(0, 500)%0A                .mapToObj(i -%3E new NamedRelativeCapability(nameBase + String.format(%22%2503d%22, i), nextChunk))%0A                .collect(Collectors.toList());%0A        CryptreeNode.ChildrenLinks childrenLinks = new CryptreeNode.ChildrenLinks(children);%0A        CryptreeNode.DirAndChildren dir = CryptreeNode.createDir(MaybeMultihash.empty(), rBase,%0A                wBase, Optional.of(signingPair), props, parentCap, parent, nextChunk, childrenLinks, crypto.hasher).join();%0A%0A        byte%5B%5D raw = dir.dir.serialize();%0A        Assert.assertTrue(raw.length %3C Fragment.MAX_LENGTH);%0A    %7D%0A%7D%0A

Add test for large directory raw cryptree size