### Question:
TransactUtils { public static List<Insert> extractInsert(TransactionBuilder transaction, GenericTableSchema schema) { List<Operation> operations = transaction.getOperations(); List<Insert> inserts = new ArrayList<>(); for (Operation operation : operations) { if (operation instanceof Insert && operation.getTableSchema().equals(schema)) { inserts.add((Insert) operation); } } return inserts; } private  TransactUtils(); static Map<InstanceIdentifier<Node>,Node> extractNode(
            Map<InstanceIdentifier<?>, DataObject> changes); static Map<InstanceIdentifier<T>,T> extractCreated(
            DataChangeEvent changes, Class<T> klazz); static Map<InstanceIdentifier<T>, T> extractCreated(
            Collection<DataTreeModification<U>> changes, Class<T> clazz); static Map<InstanceIdentifier<T>,T> extractUpdated(
            DataChangeEvent changes, Class<T> klazz); static Map<InstanceIdentifier<T>, T> extractUpdated(
            Collection<DataTreeModification<U>> changes, Class<T> clazz); static Map<InstanceIdentifier<T>, T> extractCreatedOrUpdated(
            Collection<DataTreeModification<U>> changes, Class<T> clazz,
            Predicate<DataObjectModification<T>> filter); static Map<InstanceIdentifier<T>,T> extractCreatedOrUpdated(
            DataChangeEvent changes,Class<T> klazz); static Map<InstanceIdentifier<T>, T> extractCreatedOrUpdated(
            Collection<DataTreeModification<U>> changes, Class<T> clazz); static Map<InstanceIdentifier<T>, T> extractCreatedOrUpdatedOrRemoved(
            DataChangeEvent changes, Class<T> klazz); static Map<InstanceIdentifier<T>, T> extractCreatedOrUpdatedOrRemoved(
            Collection<DataTreeModification<U>> changes, Class<T> clazz); static Map<InstanceIdentifier<T>,T> extractOriginal(
            DataChangeEvent changes, Class<T> klazz); static Map<InstanceIdentifier<T>, T> extractOriginal(
            Collection<DataTreeModification<U>> changes, Class<T> clazz); static Set<InstanceIdentifier<T>> extractRemoved(
            DataChangeEvent changes, Class<T> klazz); static Set<InstanceIdentifier<T>> extractRemoved(
            Collection<DataTreeModification<U>> changes, Class<T> clazz); static Map<InstanceIdentifier<T>, T> extractRemovedObjects(
            DataChangeEvent changes, Class<T> klazz); static Map<InstanceIdentifier<T>, T> extractRemovedObjects(
            Collection<DataTreeModification<U>> changes, Class<T> clazz); static Map<InstanceIdentifier<T>,T> extract(
            Map<InstanceIdentifier<?>, DataObject> changes, Class<T> klazz); static List<Insert> extractInsert(TransactionBuilder transaction, GenericTableSchema schema); static UUID extractNamedUuid(Insert insert); static void stampInstanceIdentifier(TransactionBuilder transaction,
            InstanceIdentifier<?> iid, TableSchema<T> tableSchema, ColumnSchema<T, Map<String, String>> columnSchema,
            InstanceIdentifierCodec instanceIdentifierCodec); static Mutate<T> stampInstanceIdentifierMutation(TransactionBuilder transaction,
            InstanceIdentifier<?> iid, TableSchema<T> tableSchema, ColumnSchema<T, Map<String, String>> columnSchema,
            InstanceIdentifierCodec instanceIdentifierCodec); static String bytesToHexString(byte[] bytes);  }### Answer:
@SuppressWarnings("rawtypes") @Test public void testExtractInsert() { TransactionBuilder transaction = mock(TransactionBuilder.class); GenericTableSchema schema = mock(GenericTableSchema.class); List<Operation> operations = new ArrayList<>(); Operation operation = mock(Insert.class); operations.add(operation); when(transaction.getOperations()).thenReturn(operations); when(operation.getTableSchema()).thenReturn(schema); List<Insert> inserts = TransactUtils.extractInsert(transaction, schema); assertEquals(operation, inserts.get(0)); }