mimaison commented on code in PR #17633:
URL: https://github.com/apache/kafka/pull/17633#discussion_r1822719923
##########
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:
Yeah I kind of refrained myself from using `Set.of()`/`List.of()` to not
cause too many changes but in this case it makes sense to use `Set.of()` and
remove the ugly `static` block. Done, thanks!
--
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]