@Test
  public void testNoMaster() throws Exception {
    final MasterAddressTracker addressTracker = setupMasterTracker(null, 1772);
    assertFalse(addressTracker.hasMaster());
    assertNull("should get null master when none active.", addressTracker.getMasterAddress());
    assertEquals("Should receive 0 for backup not found.", 0, addressTracker.getMasterInfoPort());
  }
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