@Test(expected=IllegalAccessError.class) public void testDisableWithoutEnablingWillThrowException() throws Exception { Discovery discovery = new Discovery(); discovery.disable(); }
public void disable() { if (thread != null) { thread.stopDiscovery(); thread = null; } else { throw new IllegalAccessError("Discovery not running"); } }
Discovery { public void disable() { if (thread != null) { thread.stopDiscovery(); thread = null; } else { throw new IllegalAccessError("Discovery not running"); } } }
Discovery { public void disable() { if (thread != null) { thread.stopDiscovery(); thread = null; } else { throw new IllegalAccessError("Discovery not running"); } } Discovery();  Discovery(int port);  Discovery(String multicastAddress, int port); }
Discovery { public void disable() { if (thread != null) { thread.stopDiscovery(); thread = null; } else { throw new IllegalAccessError("Discovery not running"); } } Discovery();  Discovery(int port);  Discovery(String multicastAddress, int port); void setDisoveryListener(DiscoveryListener listener); void enable(DiscoveryListener listener); void enable(); void disable(); }
Discovery { public void disable() { if (thread != null) { thread.stopDiscovery(); thread = null; } else { throw new IllegalAccessError("Discovery not running"); } } Discovery();  Discovery(int port);  Discovery(String multicastAddress, int port); void setDisoveryListener(DiscoveryListener listener); void enable(DiscoveryListener listener); void enable(); void disable();  }