private void cacheAuditLog(final AuditLog auditLog) { initializeIfNeeded(auditLog.getAuditedEntityId()); auditLogsCache.get(auditLog.getAuditedEntityId()).add(auditLog); }
@Override public boolean apply(final AuditLog auditLog) { // As we consume the data source, cache the entries cacheAuditLog(auditLog); return objectId.equals(auditLog.getAuditedEntityId()) && // Given our ordering, this should always be true for the first entry ChangeType.INSERT.equals(auditLog.getChangeType()); } }).orNull();