### Question:
NetworkClient extends ServiceUtil { public static void writeConsumerNamedSelector(TenantId tenantId, ConsumerNamedSelector consumerNamedSelector, WriteTransaction writeTx) { Preconditions.checkNotNull(consumerNamedSelector); writeTx.put(LogicalDatastoreType.CONFIGURATION, IidFactory.consumerNamedSelectorIid(tenantId, EPG_ID, consumerNamedSelector.getName()), consumerNamedSelector, true); }  static void writeNetworkClientEntitiesToTenant(TenantId tenantId, WriteTransaction writeTx); static void writeConsumerNamedSelector(TenantId tenantId, ConsumerNamedSelector consumerNamedSelector,
            WriteTransaction writeTx); static final EndpointGroupId EPG_ID; static final EndpointGroup EPG; }### Answer:
@Test public void testWriteConsumerNamedSelector() throws Exception { ConsumerNamedSelectorBuilder cnsb = new ConsumerNamedSelectorBuilder(); cnsb.setName(selector).setKey(new ConsumerNamedSelectorKey(selector)); DataBroker dataBroker = getDataBroker(); ReadWriteTransaction rwTx = dataBroker.newReadWriteTransaction(); NetworkClient.writeConsumerNamedSelector(new TenantId(tenantID), cnsb.build(), rwTx); rwTx.submit().get(); PolicyAssert.assertConsumerNamedSelectorExists(dataBroker, tenantID, NetworkClient.EPG_ID.getValue(), cnsb.getName().getValue()); }
@Test public void testWriteConsumerNamedSelectorWithoutKey() throws Exception { ConsumerNamedSelectorBuilder cnsb = new ConsumerNamedSelectorBuilder(); ReadWriteTransaction rwTx = getDataBroker().newReadWriteTransaction(); exception.expect(IllegalArgumentException.class); NetworkClient.writeConsumerNamedSelector(new TenantId(tenantID), cnsb.build(), rwTx); }