问题 There is a string like " [[7], [2,2,3]] ". How can I convert this string to a List<List<Integer>> Object? This is to implement a parameter converter in JUnit5. @CsvSource({ "'[2,3,6,7]', 7, '[[7], [2, 2, 3]]'" }) I want to convert the string " [[7], [2,2,3]] " to a List<List<Integer>> Object. 回答1: Try this: you split your input string at ], [ which gives you following rows: row[0]: [[7 row[1]: 2,2,3]] then you eliminate the '[[' ']]' strings row[0]: 7 row[1]: 2,2,3 then you iterate over the