kafka/streams/integration-tests/src/test
Jhen-Yung Hsu 2e968560e0
MINOR: Cleanup simplify set initialization with Set.of (#19925)
Simplify Set initialization and reduce the overhead of creating extra
collections.

The changes mostly include:
- new HashSet<>(List.of(...))
- new HashSet<>(Arrays.asList(...)) / new HashSet<>(asList(...))
- new HashSet<>(Collections.singletonList()) / new
HashSet<>(singletonList())
- new HashSet<>(Collections.emptyList())
- new HashSet<>(Set.of())

This change takes the following into account, and we will not change to
Set.of in these scenarios:
- Require `mutability` (UnsupportedOperationException).
- Allow `duplicate` elements (IllegalArgumentException).
- Allow `null` elements (NullPointerException).
- Depend on `Ordering`. `Set.of` does not guarantee order, so it could
make tests flaky or break public interfaces.

Reviewers: Ken Huang <s7133700@gmail.com>, PoAn Yang
 <payang@apache.org>, Chia-Ping Tsai <chia7712@gmail.com>
2025-06-11 18:36:14 +08:00
..
java/org/apache/kafka/streams/integration MINOR: Cleanup simplify set initialization with Set.of (#19925) 2025-06-11 18:36:14 +08:00
resources KAFKA-9366 Upgrade log4j to log4j2 (#17373) 2024-12-14 01:14:31 +08:00
scala/org/apache/kafka/streams/integration KAFKA-17880 Move integration test from streams module to streams/integration-tests module (#17615) 2024-11-01 18:21:06 +08:00