I have a toString()
representation of an ArrayList
.
Copying the toString()
value to clipboard, I want to copy it back into my IDE editor, and create the ArrayList
instance in one line. In fact, what I'm really doing is this:
- my ArrayList.toString() has data I need to setup a unit test.
- I want to copy this ArrayList.toString() into my editor to build a test against this edge case
- I don't want to parse anything by hand
My input looks like this:
[15.82, 15.870000000000001, 15.92, 16.32, 16.32, 16.32, 16.32, 17.05, 17.05, 17.05, 17.05, 18.29, 18.29, 19.16]
The following do not work:
Arrays.asList()
- google collections
Lists.newArrayList()
Suggestions?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…