class DistributedData implements Writable {

  synchronized public void format() throws IOException {
    setDataVersion(0);
    setIsInIncrementRestoreStage(false, false);
  }

}

class DistributedDataTest {

  static ExampleData exampleData;

  @Test
  public void format() throws Exception {

    exampleData.write("jiwan@taobao.com");
    assertThat(exampleData.getDataVersion() == 1, is(true));
    assertThat(exampleData.read().equals("jiwan@taobao.com"), is(true));
    exampleData.format();
    assertThat(exampleData.getDataVersion() == 0, is(true));
    assertThat(exampleData.read().isEmpty(), is(true));
  }

}