private void writeL2BridgeDomain(
     TenantId tenantId, L2BridgeDomain l2Bd, ReadWriteTransaction rwTx) {
   checkNotNull(l2Bd);
   L2BridgeDomainId l2BdId = l2Bd.getId();
   rwTx.put(
       LogicalDatastoreType.CONFIGURATION, IidFactory.l2BridgeDomainIid(tenantId, l2BdId), l2Bd);
 }
  @SuppressWarnings("unchecked")
  @Before
  public void initialise() throws Exception {
    epKey = mock(EndpointKey.class);
    endpoint = mock(Endpoint.class);
    readTransaction = mock(ReadOnlyTransaction.class);
    writeTransaction = mock(ReadWriteTransaction.class);

    CheckedFuture<Optional<Endpoint>, ReadFailedException> readFuture = mock(CheckedFuture.class);
    when(readTransaction.read(any(LogicalDatastoreType.class), any(InstanceIdentifier.class)))
        .thenReturn(readFuture);
    readOptional = mock(Optional.class);
    when(readFuture.checkedGet()).thenReturn(readOptional);

    OfOverlayContext ofc = mock(OfOverlayContext.class);
    when(endpoint.getAugmentation(OfOverlayContext.class)).thenReturn(ofc);

    submitFuture = mock(CheckedFuture.class);
    when(writeTransaction.submit()).thenReturn(submitFuture);
  }
 private void writeL3Context(TenantId tenantId, L3Context l3Ct, ReadWriteTransaction rwTx) {
   checkNotNull(l3Ct);
   L3ContextId l3CtId = l3Ct.getId();
   rwTx.put(LogicalDatastoreType.CONFIGURATION, IidFactory.l3ContextIid(tenantId, l3CtId), l3Ct);
 }