### Question:
MatchupGenerator extends BasicTool { static void persistReferenceObservations(List<ReferenceObservation> referenceObservations, PersistenceManager pm, Stack<EntityTransaction> rollbackStack) { rollbackStack.push(pm.transaction()); for (final ReferenceObservation r : referenceObservations) { pm.persist(r); } pm.commit(); } MatchupGenerator(); static void main(String[] args); @Override void initialize();  }### Answer:
@Test public void testPersistReferenceObservations() { final Stack<EntityTransaction> transactionStack = new Stack<>(); final EntityTransaction transaction = mock(EntityTransaction.class); final PersistenceManager persistenceManager = mock(PersistenceManager.class); final List<ReferenceObservation> observations = new ArrayList<>(); observations.add(new ReferenceObservation()); observations.add(new ReferenceObservation()); when(persistenceManager.transaction()).thenReturn(transaction); MatchupGenerator.persistReferenceObservations(observations, persistenceManager, transactionStack); verify(persistenceManager, times(1)).transaction(); verify(persistenceManager, times(2)).persist(any(ReferenceObservation.class)); verify(persistenceManager, times(1)).commit(); verifyNoMoreInteractions(persistenceManager); assertEquals(1, transactionStack.size()); assertSame(transaction, transactionStack.pop()); }