@Test
  public void testNoBackups() throws Exception {
    final ServerName sn =
      ServerName.valueOf("localhost", 1234, EnvironmentEdgeManager.currentTime());
    final MasterAddressTracker addressTracker = setupMasterTracker(sn, 1772);
    try {
      assertEquals("Should receive 0 for backup not found.", 0,
        addressTracker.getBackupMasterInfoPort(ServerName.valueOf("doesnotexist.example.com", 1234,
          EnvironmentEdgeManager.currentTime())));
    } finally {
      assertTrue("Couldn't clean up master",
        MasterAddressTracker.deleteIfEquals(addressTracker.getWatcher(), sn.toString()));
    }
  }
Unit tests that uses ZooKeeper but does not use the master-side methods but rather acts
directly on ZK.
hbase-zookeeper/src/test/java/org/apache/hadoop/hbase/zookeeper/TestMasterAddressTracker.java