@Override
  public void write(DataOutput out) throws IOException {
    super.write(out);
    writeToOutput(out);
  }
@Test
  public void testWrite() throws IOException {
    // create a mock for DataOutput that will be used in the write method
    // this way we can capture and verify if correct arguments were passed
    DataOutput out = mock(DataOutput.class);

    // register expected method calls for void functions
    // so that we can verify what was called after the method call finishes
    doNothing().when(out).writeByte(anyInt());
    doNothing().when(out).writeInt(anyInt());
    doNothing().when(out).write(any(byte[].class), anyInt(), anyInt());
    doNothing().when(out).write(any(byte[].class));

    // call the method we want to test with the mocked input
    split.write(out);

    // verify the method calls on the mocked object in the order of the calls
    InOrder inorder = inOrder(out);
    inorder.verify(out, times(1)).writeByte(eq(fileSplitName.length()));
    inorder.verify(out, times(1)).write(aryEq(Text.encode(fileSplitName).array()), eq(0), eq(fileSplitName.length()));
    inorder.verify(out, times(1)).writeInt(eq(basePath.length()));
    inorder.verify(out, times(1)).write(aryEq(getUTF8Bytes(basePath)));
    inorder.verify(out, times(1)).writeInt(eq(maxCommitTime.length()));
    inorder.verify(out, times(1)).write(aryEq(getUTF8Bytes(maxCommitTime)));
    inorder.verify(out, times(1)).writeInt(eq(deltaLogPaths.size()));
    inorder.verify(out, times(1)).writeInt(eq(deltaLogPaths.get(0).length()));
    inorder.verify(out, times(1)).write(aryEq(getUTF8Bytes(deltaLogPaths.get(0))));
    inorder.verify(out, times(1)).writeBoolean(false);
    // verify there are no more interactions happened on the mocked object
    inorder.verifyNoMoreInteractions();
  }