@Test public void shouldSetChannelFreeFlagToFalse() { when(channel1.isFree()).thenReturn(true); Channel channel = node.getFreeChannel(); assertSame(channel1, channel); verify(channel1).setFree(false); }
public synchronized Channel getFreeChannel() { for (Channel c : channels) { if (c.isFree()) { c.setFree(false); return c; } } return null; }
Node { public synchronized Channel getFreeChannel() { for (Channel c : channels) { if (c.isFree()) { c.setFree(false); return c; } } return null; } }
Node { public synchronized Channel getFreeChannel() { for (Channel c : channels) { if (c.isFree()) { c.setFree(false); return c; } } return null; } Node(AntChipInterface antchip); }
Node { public synchronized Channel getFreeChannel() { for (Channel c : channels) { if (c.isFree()) { c.setFree(false); return c; } } return null; } Node(AntChipInterface antchip); AntChipInterface getAntChip(); synchronized void registerStatusListener(
			BroadcastListener<AntStatusUpdate> listener); synchronized void removeStatusListener(
			BroadcastListener<AntStatusUpdate> listener); synchronized List<Capability> getCapabiltites(); synchronized void start(); synchronized Channel getFreeChannel(); synchronized void freeChannel(Channel channel); @Deprecated synchronized void setNetworkKey(int network, NetworkKey key); synchronized Network getNetworkForKey(NetworkKey key); synchronized int getMaxNetworks(); synchronized int getMaxChannels(); StandardMessage sendAndWaitWithAdapter(WaitAdapter waitAdapter,
			StandardMessage msg, LockExchangeContainer lockContainer); StandardMessage sendAndWaitWithAdapter(WaitAdapter waitAdapter,
			StandardMessage msg, LockExchangeContainer lockContainer,
			MessageSender sender, Receipt receipt); synchronized void registerRxListener(
			final BroadcastListener<V> listener, final Class<V> clazz); synchronized void removeRxListener(
			final BroadcastListener<V> listener); StandardMessage sendAndWaitForMessage(final StandardMessage msg,
			final MessageCondition condition, final Long timeout,
			final TimeUnit timeoutUnit, final MessageSender sender,
			final Receipt receipt); StandardMessage sendAndWaitForMessage(final StandardMessage msg,
			final MessageCondition condition, final Long timeout,
			final TimeUnit timeoutUnit, final MessageSender sender,
			final Receipt receipt, final MessageCondition errorCheckCondition); synchronized void reset(boolean wait); void reset(); synchronized MessageMetaWrapper<StandardMessage> send(
			StandardMessage msg); synchronized void stop(); synchronized boolean isRunning(); void registerAntLogger(AntLogger logger); void unregisterAntLogger(AntLogger logger); void registerEventHandler(NodeEventHandler handler); void sendAndWaitForResponseNoError(StandardMessage msg); synchronized void setTransmitPower(int powerLevel); synchronized void setLibConfig(boolean enableChannelId, boolean enableRssi,
			boolean enableTimestamps); synchronized void enableExtendedMessages(boolean enable); }
Node { public synchronized Channel getFreeChannel() { for (Channel c : channels) { if (c.isFree()) { c.setFree(false); return c; } } return null; } Node(AntChipInterface antchip); AntChipInterface getAntChip(); synchronized void registerStatusListener(
			BroadcastListener<AntStatusUpdate> listener); synchronized void removeStatusListener(
			BroadcastListener<AntStatusUpdate> listener); synchronized List<Capability> getCapabiltites(); synchronized void start(); synchronized Channel getFreeChannel(); synchronized void freeChannel(Channel channel); @Deprecated synchronized void setNetworkKey(int network, NetworkKey key); synchronized Network getNetworkForKey(NetworkKey key); synchronized int getMaxNetworks(); synchronized int getMaxChannels(); StandardMessage sendAndWaitWithAdapter(WaitAdapter waitAdapter,
			StandardMessage msg, LockExchangeContainer lockContainer); StandardMessage sendAndWaitWithAdapter(WaitAdapter waitAdapter,
			StandardMessage msg, LockExchangeContainer lockContainer,
			MessageSender sender, Receipt receipt); synchronized void registerRxListener(
			final BroadcastListener<V> listener, final Class<V> clazz); synchronized void removeRxListener(
			final BroadcastListener<V> listener); StandardMessage sendAndWaitForMessage(final StandardMessage msg,
			final MessageCondition condition, final Long timeout,
			final TimeUnit timeoutUnit, final MessageSender sender,
			final Receipt receipt); StandardMessage sendAndWaitForMessage(final StandardMessage msg,
			final MessageCondition condition, final Long timeout,
			final TimeUnit timeoutUnit, final MessageSender sender,
			final Receipt receipt, final MessageCondition errorCheckCondition); synchronized void reset(boolean wait); void reset(); synchronized MessageMetaWrapper<StandardMessage> send(
			StandardMessage msg); synchronized void stop(); synchronized boolean isRunning(); void registerAntLogger(AntLogger logger); void unregisterAntLogger(AntLogger logger); void registerEventHandler(NodeEventHandler handler); void sendAndWaitForResponseNoError(StandardMessage msg); synchronized void setTransmitPower(int powerLevel); synchronized void setLibConfig(boolean enableChannelId, boolean enableRssi,
			boolean enableTimestamps); synchronized void enableExtendedMessages(boolean enable); final static Logger LOGGER; }