@Test
    public void offsetsAndSizesValid() throws IOException {
        SerializedFileHeader header = asset.header();

        long fileSize = Files.size(readFile);
        assertEquals("Header file size and actual file size must be equal",
                header.fileSize(), fileSize);

        assertTrue("Data offset must be within file",
                header.dataOffset() < header.fileSize());

        // allowing a difference of 3 bytes because of padding
        assertEquals("Metadata sizes in data block and header must match",
                header.metadataSize(), asset.metadataBlock().length(), 3);

        // check blocks
        List<DataBlock> blocks = asset.dataBlocks();
        blocks.forEach(block1 -> blocks.forEach(block2 -> {
            if (block1 != block2) {
                assertFalse("Blocks are overlapping: " + block1 + " / " + block2,
                        block1.isIntersecting(block2));
            }
        }));
    }
@author Nico Bergemann <barracuda415 at yahoo.de>
disunity-core/src/test/java/info/ata4/test/junity/SerializedFileTest.java