### Question:
ChannelzProtoUtil { static Channel toChannel(InternalInstrumented<ChannelStats> channel) { ChannelStats stats = getFuture(channel.getStats()); Channel.Builder channelBuilder = Channel .newBuilder() .setRef(toChannelRef(channel)) .setData(extractChannelData(stats)); for (InternalWithLogId subchannel : stats.subchannels) { channelBuilder.addSubchannelRef(toSubchannelRef(subchannel)); } return channelBuilder.build(); } private  ChannelzProtoUtil();  static final String SO_LINGER; static final String SO_TIMEOUT; static final String TCP_INFO; }### Answer:
@Test public void toChannel() throws Exception { assertEquals(channelProto, ChannelzProtoUtil.toChannel(channel)); channel.stats = toBuilder(channel.stats) .setSubchannels(ImmutableList.<InternalWithLogId>of(subchannel)) .build(); assertEquals( channelProto .toBuilder() .addSubchannelRef(subchannelRef) .build(), ChannelzProtoUtil.toChannel(channel)); TestChannel otherSubchannel = new TestChannel(); channel.stats = toBuilder(channel.stats) .setSubchannels(ImmutableList.<InternalWithLogId>of(subchannel, otherSubchannel)) .build(); assertEquals( channelProto .toBuilder() .addSubchannelRef(subchannelRef) .addSubchannelRef(ChannelzProtoUtil.toSubchannelRef(otherSubchannel)) .build(), ChannelzProtoUtil.toChannel(channel)); }