Unfortunately, you have already found the simplest solution.
In general, the general presentation of data is very inconvenient in Java because it is statically typed. Part of the CSV, XML, and other data serialization methods are that they are self-documenting in terms of the structure of the data being defined. In the case of Java, this does not work too well, because the structure must either be predefined (via the class) or read into the structure, so it is almost useless (for example, a list map or key-> where everything remains a line).
This is not hatred of Java hatred, I simply point out that making this specific work easy and intuitive is fundamentally incompatible with the functions of the Java kernel. In a dynamically typed language such as Python, such things are much simpler (and in particular in Python, they are almost trivial due to the presence of the main csv module), because you can drop any data into the object and it will adapt to match, Java should Know in advance what will happen, which leads to uncomfortable verbosity that you discover.
source share