Three options were suggested about the new API:
- ListFormat.formatting()
- ListFormat.toCollector()
- Collectors.listFormatting(ListFormat) static method
I feel it should belong to ListFormat, but I'm open to discussions.

For testing, I tested a couple of scenarios and a few corner cases (empty 
stream, null element, parallel stream) in a simple non-parameterized JUnit 
test. I believe that it's enough, given that the implementation is trivial, and 
ListFormat itself, as well as Stream API is already thoroughly tested by other 
tests. Tell me if you feel that some testing scenarios are missing, I'll 
happily add them.

---------
- [x] I confirm that I make this contribution in accordance with the [OpenJDK 
Interim AI Policy](https://openjdk.org/legal/ai).

-------------

Commit messages:
 - 8391789: Collector for ListFormat

Changes: https://git.openjdk.org/jdk/pull/32716/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=32716&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8391789
  Stats: 45 lines in 3 files changed: 43 ins; 0 del; 2 mod
  Patch: https://git.openjdk.org/jdk/pull/32716.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/32716/head:pull/32716

PR: https://git.openjdk.org/jdk/pull/32716

Reply via email to