@Test
public void testGetBeginning() {

    try {
        String file = FileOps.tempFile();
        int value = Random.getInt();
        FileChannel channel = FileChannel.open(new File(file).toPath(),
                StandardOpenOption.CREATE, StandardOpenOption.READ,
                StandardOpenOption.WRITE);
        channel.write(getByteBuffer(value));
        for (int i = 0; i < Random.getScaleCount(); ++i) {
            channel.write(getByteBuffer(Random.getInt()));
        }
        MappedAtomicInteger integer = new MappedAtomicInteger(channel);
        for (int i = 0; i < Random.getScaleCount(); ++i) {
            Assert.assertEquals(value, integer.get());
        }
    }
    catch (IOException e) {
        throw CheckedExceptions.wrapAsRuntimeException(e);
    }
}