chia7712 commented on code in PR #17633:
URL: https://github.com/apache/kafka/pull/17633#discussion_r1822511436
##########
metadata/src/test/java/org/apache/kafka/controller/BrokerHeartbeatTrackerTest.java:
##########
@@ -43,12 +43,11 @@ private static BrokerHeartbeatTracker
newBrokerHeartbeatTracker() {
private static final Set<BrokerIdAndEpoch> TEST_BROKERS;
static {
- Set<BrokerIdAndEpoch> brokers = new HashSet<>();
- Arrays.asList(
- new BrokerIdAndEpoch(0, 0L),
- new BrokerIdAndEpoch(1, 100L),
- new BrokerIdAndEpoch(2, 200L)
- ).forEach(brokers::add);
+ Set<BrokerIdAndEpoch> brokers = new HashSet<>(Arrays.asList(
Review Comment:
Maybe we can leverage `Set.of`
```java
private static final Set<BrokerIdAndEpoch> TEST_BROKERS = Set.of(
new BrokerIdAndEpoch(0, 0L),
new BrokerIdAndEpoch(1, 100L),
new BrokerIdAndEpoch(2, 200L)
);
```
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]