@Test public void testCreateDiscoveryThreadReturnsNewInstance() { Discovery discovery = new Discovery(); DiscoveryThread thread1 = discovery.createDiscoveryThread(); DiscoveryThread thread2 = discovery.createDiscoveryThread(); Assert.assertNotNull(thread1); Assert.assertNotNull(thread2); Assert.assertNotSame(thread1, thread2); }
protected DiscoveryThread createDiscoveryThread() { return new DiscoveryThread(multicastAddress, port, listener); }
Discovery { protected DiscoveryThread createDiscoveryThread() { return new DiscoveryThread(multicastAddress, port, listener); } }
Discovery { protected DiscoveryThread createDiscoveryThread() { return new DiscoveryThread(multicastAddress, port, listener); } Discovery();  Discovery(int port);  Discovery(String multicastAddress, int port); }
Discovery { protected DiscoveryThread createDiscoveryThread() { return new DiscoveryThread(multicastAddress, port, listener); } Discovery();  Discovery(int port);  Discovery(String multicastAddress, int port); void setDisoveryListener(DiscoveryListener listener); void enable(DiscoveryListener listener); void enable(); void disable(); }
Discovery { protected DiscoveryThread createDiscoveryThread() { return new DiscoveryThread(multicastAddress, port, listener); } Discovery();  Discovery(int port);  Discovery(String multicastAddress, int port); void setDisoveryListener(DiscoveryListener listener); void enable(DiscoveryListener listener); void enable(); void disable();  }