TerminalOperation (List<? extends OperationRecord> operations) { if (operations == null || operations.isEmpty()) return null; OperationRecord record = operations.get(operations.size()-1); if(record.myOperation instanceof TerminalOperation) { return (TerminalOperation)record.myOperation; } return null; }