@Test
  public void endpointIidTest() {
    L2BridgeDomainId l2Context = mock(L2BridgeDomainId.class);
    MacAddress macAddress = mock(MacAddress.class);
    InstanceIdentifier<Endpoint> identifier = IidFactory.endpointIid(l2Context, macAddress);
    Assert.assertEquals(l2Context, InstanceIdentifier.keyOf(identifier).getL2Context());
    Assert.assertEquals(macAddress, InstanceIdentifier.keyOf(identifier).getMacAddress());

    EndpointKey key = mock(EndpointKey.class);
    identifier = IidFactory.endpointIid(key);
    Assert.assertEquals(key, identifier.firstKeyOf(Endpoint.class));
  }
 @Test
 public void subnetIidTest() {
   SubnetId subnetId = mock(SubnetId.class);
   InstanceIdentifier<Subnet> identifier = IidFactory.subnetIid(tenantId, subnetId);
   Assert.assertEquals(tenantId, identifier.firstKeyOf(Tenant.class).getId());
   Assert.assertEquals(subnetId, identifier.firstKeyOf(Subnet.class).getId());
 }
 @Test
 public void l3ContextIidTest() {
   L3ContextId l3ContextId = mock(L3ContextId.class);
   InstanceIdentifier<L3Context> identifier = IidFactory.l3ContextIid(tenantId, l3ContextId);
   Assert.assertEquals(l3ContextId, InstanceIdentifier.keyOf(identifier).getId());
   Assert.assertEquals(tenantId, identifier.firstKeyOf(Tenant.class).getId());
 }
 @Test
 public void l3EndpointIidTest() {
   L3ContextId l3ContextId = mock(L3ContextId.class);
   IpAddress ipAddress = mock(IpAddress.class);
   InstanceIdentifier<EndpointL3> identifier = IidFactory.l3EndpointIid(l3ContextId, ipAddress);
   Assert.assertEquals(l3ContextId, InstanceIdentifier.keyOf(identifier).getL3Context());
   Assert.assertEquals(ipAddress, InstanceIdentifier.keyOf(identifier).getIpAddress());
 }
 @Test
 public void l2BridgeDomainIidTest() {
   L2BridgeDomainId l2BridgeDomainId = mock(L2BridgeDomainId.class);
   InstanceIdentifier<L2BridgeDomain> identifier =
       IidFactory.l2BridgeDomainIid(tenantId, l2BridgeDomainId);
   Assert.assertEquals(l2BridgeDomainId, InstanceIdentifier.keyOf(identifier).getId());
   Assert.assertEquals(tenantId, identifier.firstKeyOf(Tenant.class).getId());
 }
 @Test
 public void classifierInstanceIidTest() {
   ClassifierName classifierName = mock(ClassifierName.class);
   InstanceIdentifier<ClassifierInstance> identifier =
       IidFactory.classifierInstanceIid(tenantId, classifierName);
   Assert.assertEquals(classifierName, InstanceIdentifier.keyOf(identifier).getName());
   Assert.assertEquals(tenantId, identifier.firstKeyOf(Tenant.class).getId());
 }
 @Test
 public void actionInstanceIidTest() {
   ActionName actionName = mock(ActionName.class);
   InstanceIdentifier<ActionInstance> identifier =
       IidFactory.actionInstanceIid(tenantId, actionName);
   Assert.assertEquals(actionName, InstanceIdentifier.keyOf(identifier).getName());
   Assert.assertEquals(tenantId, identifier.firstKeyOf(Tenant.class).getId());
 }
 @Test
 public void subjectIidTest() {
   SubjectName subjectName = mock(SubjectName.class);
   InstanceIdentifier<Subject> identifier =
       IidFactory.subjectIid(tenantId, contractId, subjectName);
   Assert.assertEquals(subjectName, InstanceIdentifier.keyOf(identifier).getName());
   Assert.assertEquals(contractId, identifier.firstKeyOf(Contract.class).getId());
   Assert.assertEquals(tenantId, identifier.firstKeyOf(Tenant.class).getId());
 }
 @Test
 public void endpointL3PrefixIidTest() {
   L3ContextId l3Context = mock(L3ContextId.class);
   IpPrefix ipPrefix = mock(IpPrefix.class);
   InstanceIdentifier<EndpointL3Prefix> identifier =
       IidFactory.endpointL3PrefixIid(l3Context, ipPrefix);
   Assert.assertEquals(l3Context, InstanceIdentifier.keyOf(identifier).getL3Context());
   Assert.assertEquals(ipPrefix, InstanceIdentifier.keyOf(identifier).getIpPrefix());
 }
 @Test
 public void ruleIdTest() {
   InstanceIdentifier<Rule> identifier =
       IidFactory.ruleIid(tenantId, contractId, subjectName, ruleName);
   Assert.assertEquals(ruleName, InstanceIdentifier.keyOf(identifier).getName());
   Assert.assertEquals(subjectName, identifier.firstKeyOf(Subject.class).getName());
   Assert.assertEquals(contractId, identifier.firstKeyOf(Contract.class).getId());
   Assert.assertEquals(tenantId, identifier.firstKeyOf(Tenant.class).getId());
 }
 @Test
 public void consumerNamedSelectorIidTest() {
   SelectorName consumerSelectorName = mock(SelectorName.class);
   InstanceIdentifier<ConsumerNamedSelector> identifier =
       IidFactory.consumerNamedSelectorIid(tenantId, epgId, consumerSelectorName);
   Assert.assertEquals(consumerSelectorName, InstanceIdentifier.keyOf(identifier).getName());
   Assert.assertEquals(epgId, identifier.firstKeyOf(EndpointGroup.class).getId());
   Assert.assertEquals(tenantId, identifier.firstKeyOf(Tenant.class).getId());
 }
 @Test
 public void classifierRefIidTest() {
   ClassifierName classifierRefName = mock(ClassifierName.class);
   InstanceIdentifier<ClassifierRef> identifier =
       IidFactory.classifierRefIid(tenantId, contractId, subjectName, ruleName, classifierRefName);
   Assert.assertEquals(classifierRefName, InstanceIdentifier.keyOf(identifier).getName());
   Assert.assertEquals(ruleName, identifier.firstKeyOf(Rule.class).getName());
   Assert.assertEquals(subjectName, identifier.firstKeyOf(Subject.class).getName());
   Assert.assertEquals(contractId, identifier.firstKeyOf(Contract.class).getId());
   Assert.assertEquals(tenantId, identifier.firstKeyOf(Tenant.class).getId());
 }
 @Test
 public void contractIidTest() {
   InstanceIdentifier<Contract> identifier = IidFactory.contractIid(tenantId, contractId);
   Assert.assertEquals(contractId, InstanceIdentifier.keyOf(identifier).getId());
   Assert.assertEquals(tenantId, identifier.firstKeyOf(Tenant.class).getId());
 }
 @Test
 public void endpointGroupIidTest() {
   InstanceIdentifier<EndpointGroup> identifier = IidFactory.endpointGroupIid(tenantId, epgId);
   Assert.assertEquals(epgId, InstanceIdentifier.keyOf(identifier).getId());
   Assert.assertEquals(tenantId, identifier.firstKeyOf(Tenant.class).getId());
 }
 @Test
 public void tenantIdTest() {
   InstanceIdentifier<Tenant> identifier = IidFactory.tenantIid(tenantId);
   Assert.assertEquals(tenantId, InstanceIdentifier.keyOf(identifier).getId());
 }
 @Test
 public void endpointIidWildcardTest() {
   InstanceIdentifier<Endpoints> identifier = IidFactory.endpointsIidWildcard();
   Assert.assertNotNull(identifier);
 }