private void createWALFile(Path file) throws Exception {
    ProtobufLogWriter writer = new ProtobufLogWriter();
    try {
      writer.init(FS, file, CONF, false, FS.getDefaultBlockSize(file), null);
      WALKeyImpl key = new WALKeyImpl(RI.getEncodedNameAsBytes(), TABLE_NAME,
        EnvironmentEdgeManager.currentTime(), SCOPES);
      WALEdit edit = new WALEdit();
      WALEditInternalHelper.addExtendedCell(edit,
        ExtendedCellBuilderFactory.create(CellBuilderType.SHALLOW_COPY).setRow(F1).setFamily(F1)
          .setQualifier(F1).setType(Cell.Type.Put).setValue(F1).build());
      WALEditInternalHelper.addExtendedCell(edit,
        ExtendedCellBuilderFactory.create(CellBuilderType.SHALLOW_COPY).setRow(F2).setFamily(F2)
          .setQualifier(F2).setType(Cell.Type.Put).setValue(F2).build());
      writer.append(new WAL.Entry(key, edit));
      writer.sync(false);
    } finally {
      writer.close();
    }
  }
Remove a peer and wait for it to get cleaned up
hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationSourceManager.java