### Question:
GbpNetconfTransaction { public static <T extends DataObject> boolean netconfSyncedWrite(@Nonnull final InstanceIdentifier<Node> vppIid, @Nonnull final InstanceIdentifier<T> iid, @Nonnull final T data, byte retryCounter) { VbdNetconfTransaction.NODE_DATA_BROKER_MAP.get(vppIid).getValue().lock(); boolean result = write(VbdNetconfTransaction.NODE_DATA_BROKER_MAP.get(vppIid).getKey(), iid, data, retryCounter); VbdNetconfTransaction.NODE_DATA_BROKER_MAP.get(vppIid).getValue().unlock(); return result; }  static boolean netconfSyncedWrite(@Nonnull final InstanceIdentifier<Node> vppIid,
        @Nonnull final InstanceIdentifier<T> iid, @Nonnull final T data, byte retryCounter); static boolean netconfSyncedWrite(@Nonnull final InstanceIdentifier<Node> vppIid,
            @Nonnull final Map<InstanceIdentifier<T>,T> data, byte retryCounter); static boolean netconfSyncedMerge(@Nonnull final InstanceIdentifier<Node> vppIid,
        @Nonnull final InstanceIdentifier<T> iid, @Nonnull final T data, byte retryCounter); static boolean netconfSyncedMerge(@Nonnull final InstanceIdentifier<Node> vppIid,
        @Nonnull final ConfigCommand command, byte retryCounter); static boolean netconfSyncedWrite(@Nonnull final InstanceIdentifier<Node> vppIid,
        @Nonnull final ConfigCommand command, byte retryCounter); static boolean netconfSyncedWrite(@Nonnull final InstanceIdentifier<Node> vppIid,
        @Nonnull final RoutingCommand command, byte retryCounter); static boolean netconfSyncedDelete(@Nonnull final InstanceIdentifier<Node> vppIid,
        @Nonnull final InstanceIdentifier<T> iid, byte retryCounter); static boolean netconfSyncedDelete(@Nonnull final InstanceIdentifier<Node> vppIid,
            @Nonnull Set<InstanceIdentifier<T>> iids , byte retryCounter); static boolean netconfSyncedDelete(@Nonnull final InstanceIdentifier<Node> vppIid,
        @Nonnull final ConfigCommand command, byte retryCounter); static boolean netconfSyncedDelete(@Nonnull final InstanceIdentifier<Node> vppIid,
        @Nonnull final RoutingCommand command, byte retryCounter); static synchronized Optional<T> read(final InstanceIdentifier<Node> vppIid,
        final LogicalDatastoreType datastoreType, final InstanceIdentifier<T> iid, byte retryCounter); static final byte RETRY_COUNT; }### Answer:
@Test public void writeConfigCommandReattemptTest() { doThrow(new IllegalStateException()).when(command).execute(rwTx); final boolean result = GbpNetconfTransaction.netconfSyncedWrite(nodeIid, command, (byte) 5); verify(dataBroker, times(6)).newReadWriteTransaction(); assertFalse(result); }
@Test public void writeConfigCommandTest() throws Exception { when(rwTx.submit()).thenReturn(future); doNothing().when(command).execute(rwTx); when(future.get()).thenReturn(null); final boolean result = GbpNetconfTransaction.netconfSyncedWrite(nodeIid, command, (byte)5); verify(dataBroker, times(1)).newReadWriteTransaction(); assertTrue(result); }
@Test public void writeDataReattemptTest() { doThrow(new IllegalStateException()).when(rwTx).put(LogicalDatastoreType.CONFIGURATION, nodeIid, node, true); final boolean result = GbpNetconfTransaction.netconfSyncedWrite(nodeIid, nodeIid, node, (byte) 5); verify(dataBroker, times(6)).newReadWriteTransaction(); assertFalse(result); }
@Test public void writeDataTest() throws Exception { when(rwTx.submit()).thenReturn(future); doNothing().when(rwTx).put(LogicalDatastoreType.CONFIGURATION, nodeIid, node, true); when(future.get()).thenReturn(null); final boolean result = GbpNetconfTransaction.netconfSyncedWrite(nodeIid, nodeIid, node, (byte) 5); verify(dataBroker, times(1)).newReadWriteTransaction(); assertTrue(result); }