junrao commented on code in PR #13255: URL: https://github.com/apache/kafka/pull/13255#discussion_r1110260488
########## core/src/test/scala/other/kafka/StressTestLog.scala: ########## @@ -123,7 +123,8 @@ object StressTestLog { class WriterThread(val log: UnifiedLog) extends WorkerThread with LogProgress { override def work(): Unit = { val logAppendInfo = log.appendAsLeader(TestUtils.singletonRecords(currentOffset.toString.getBytes), 0) - require(logAppendInfo.firstOffset.forall(_.messageOffset == currentOffset) && logAppendInfo.lastOffset == currentOffset) + require((!logAppendInfo.firstOffset.isPresent || logAppendInfo.firstOffset.get().messageOffset == currentOffset) Review Comment: It seems that `logAppendInfo.firstOffset.isEmpty` is simpler than `!logAppendInfo.firstOffset.isPresent`. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org