protected final void waitUntilReplicationDone(int expectedEntries) throws Exception {
    UTIL.waitFor(30000, new ExplainingPredicate<Exception>() {

      @Override
      public boolean evaluate() throws Exception {
        try {
          return NoEOFWALStreamReader.count(FS, logPath, UTIL.getConfiguration())
              >= expectedEntries;
        } catch (IOException e) {
          return false;
        }
      }

      @Override
      public String explainFailure() throws Exception {
        return "Not enough entries replicated";
      }
    });
  }
Base class for testing serial replication.
hbase-server/src/test/java/org/apache/hadoop/hbase/replication/SerialReplicationTestBase.java