### Question:
ProducerManager { public void registerProducer(final String group, final ClientChannelInfo clientChannelInfo) { try { ClientChannelInfo clientChannelInfoFound = null; if (this.hashcodeChannelLock.tryLock(LOCK_TIMEOUT_MILLIS, TimeUnit.MILLISECONDS)) { try { List<ClientChannelInfo> clientChannelInfoList = this.hashcodeChannelTable.get(group.hashCode()); if (null == clientChannelInfoList) { clientChannelInfoList = new ArrayList<ClientChannelInfo>(); this.hashcodeChannelTable.put(group.hashCode(), clientChannelInfoList); } int index = clientChannelInfoList.indexOf(clientChannelInfo); if (index >= 0) { clientChannelInfoFound = clientChannelInfoList.get(index); } if (null == clientChannelInfoFound) { clientChannelInfoList.add(clientChannelInfo); } } finally { this.hashcodeChannelLock.unlock(); } if (clientChannelInfoFound != null) { clientChannelInfoFound.setLastUpdateTimestamp(System.currentTimeMillis()); } } else { log.warn("ProducerManager registerProducer lock timeout"); } } catch (InterruptedException e) { log.error("", e); } try { ClientChannelInfo clientChannelInfoFound = null; if (this.groupChannelLock.tryLock(LOCK_TIMEOUT_MILLIS, TimeUnit.MILLISECONDS)) { try { HashMap<Channel, ClientChannelInfo> channelTable = this.groupChannelTable.get(group); if (null == channelTable) { channelTable = new HashMap<>(); this.groupChannelTable.put(group, channelTable); } clientChannelInfoFound = channelTable.get(clientChannelInfo.getChannel()); if (null == clientChannelInfoFound) { channelTable.put(clientChannelInfo.getChannel(), clientChannelInfo); log.info("new producer connected, group: {} channel: {}", group, clientChannelInfo.toString()); } } finally { this.groupChannelLock.unlock(); } if (clientChannelInfoFound != null) { clientChannelInfoFound.setLastUpdateTimestamp(System.currentTimeMillis()); } } else { log.warn("ProducerManager registerProducer lock timeout"); } } catch (InterruptedException e) { log.error("", e); } } ProducerManager(); HashMap<String, HashMap<Channel, ClientChannelInfo>> getGroupChannelTable(); void scanNotActiveChannel(); void doChannelCloseEvent(final String remoteAddr, final Channel channel); void registerProducer(final String group, final ClientChannelInfo clientChannelInfo); void unregisterProducer(final String group, final ClientChannelInfo clientChannelInfo); ClientChannelInfo pickProducerChannelRandomly(final int producerGroupHashCode);  }### Answer:
@Test public void testRegisterProducer() throws Exception { producerManager.registerProducer(group, clientInfo); HashMap<Channel, ClientChannelInfo> channelMap = producerManager.getGroupChannelTable().get(group); assertThat(channelMap).isNotNull(); assertThat(channelMap.get(channel)).isEqualTo(clientInfo); }