CachedDawgClientFactory implements IDawgClientFactory { @Override public PowerClient getPowerClient() { if (null == powerClient) { powerClient = new PowerClient(stb); } return powerClient; } CachedDawgClientFactory(MetaStb metaStb);  CachedDawgClientFactory(MetaStb metaStb, String dawgHouseHost, String dawgPoundHost); @Override IDawgHouseClient<?> getHouseClient(); @Override IDawgPoundClient getPoundClient(); @Override IrClient getIrClient(); @Override PowerClient getPowerClient(); @Override SerialClient getSerialClient();  }
@Test(expectedExceptions=IllegalArgumentException.class) public void testGetPowerClientWithNullParam() { CachedDawgClientFactory factory = new CachedDawgClientFactory(null); factory.getPowerClient(); }
@Test public void testGetPowerClient() { CachedDawgClientFactory factory = new CachedDawgClientFactory(new MetaStb(),"",""); Assert.assertNotNull(factory.getPowerClient()); PowerClient expected = factory.getPowerClient(); Assert.assertEquals(factory.getPowerClient(), expected); }