@Test
public void testWrite() throws IOException {

  stream = new RandomAccessFileOutputStream(tempFile, 1L);
  stream.write(7);
  stream.flush();
  stream.close();
  FileInputStream in = null;
  try {
    in = new FileInputStream(tempFile);
    Assert.assertEquals(7, in.read());
  } finally {
    try {
      in.close();
    } catch (Exception ignored) {
      // Nothing
    }
  }
}