MappedFieldsTracker { public void commitTransaction(Integer txId) { final UndoLog undoLog = pendingTransactions.get(txId); if (undoLog == null) { throw new IllegalStateException("No transaction with ID " + txId); } if (pendingTransactions.firstKey().equals(txId)) { pendingTransactions.clear(); } }  Integer startTransaction(); void commitTransaction(Integer txId); void rollbackTransaction(Integer txId); boolean hasTransaction(); void put(Object src, Object dest, String mapId); void put(Object src, Object dest); Object getMappedValue(Object src, Class<?> destType, String mapId); Object getMappedValue(Object src, Class<?> destType);  }
@Test public void testTransaction_unknownCommit() { exception.expect(IllegalStateException.class); exception.expectMessage("No transaction with ID 0"); tracker.commitTransaction(0); }