### Question:
TransactUtils { public static <T extends DataObject> Map<InstanceIdentifier<T>, T> extractRemovedObjects( DataChangeEvent changes, Class<T> klazz) { Set<InstanceIdentifier<T>> iids = extractRemoved(changes, klazz); return Maps.filterKeys(extractOriginal(changes, klazz),Predicates.in(iids)); } 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:
@Test public void testExtractRemovedObjects() { Set<InstanceIdentifier<DataObject>> iids = new HashSet<>(); PowerMockito.doReturn(iids).when(TransactUtils.class); TransactUtils.extractRemoved(any(DataChangeEvent.class), eq(DataObject.class)); Map<InstanceIdentifier<DataObject>, DataObject> result = new HashMap<>(); PowerMockito.doReturn(result).when(TransactUtils.class); TransactUtils.extractOriginal(any(DataChangeEvent.class), eq(DataObject.class)); Class<DataObject> klazz = DataObject.class; DataChangeEvent changes = mock(DataChangeEvent.class); assertEquals(Maps.filterKeys(result, Predicates.in(iids)), TransactUtils.extractRemovedObjects(changes, klazz)); }