UDPHeartBeat { public void stop() { if (thread != null) { pleaseStop = true; if (thread.isAlive()) { thread.interrupt(); try { thread.join(); } catch (InterruptedException e) { e.printStackTrace(); } } } setStatus(Status.STOPPED); } UDPHeartBeat(HeartBeatConfiguration configuration, HeartBeatInfo me);  UDPHeartBeat(HeartBeatConfiguration configuration, HeartBeatInfo me, BeatListener beatListener); void stop(); void start();  }
@Test public void testStop() throws Exception { UDPHeartBeat heartBeat = new UDPHeartBeat(conf, me); heartBeat.stop(); }