Commit (@NotNull Set<? extends Commit> commits) { long maxTimeStamp = Long.MIN_VALUE; Commit lastCommit = null; for (Commit commit : commits) { if (commit.getTimestamp() >= maxTimeStamp) { maxTimeStamp = commit.getTimestamp(); lastCommit = commit; } } assert lastCommit != null; return lastCommit; }