title: Convert string representation of a list to a list in Java
body: <p>Is there any easy, one (not too complicated) line for this?</p>
  
  <p>If we have <code>List&lt;String&gt; li1 = Arrays.asList("a","b");</code>, then <code>li1.toString()</code> will yield <code>[a, b]</code>. So how to convert string <code>[a, b]</code> to a list of strings?</p>
  
  <p>Connected with it is the question why produced string isn't <code>["a","b"]</code>? Because from string representations we cannot distinguish <code>Arrays.asList("1","2","3")</code> from <code>Arrays.asList(1,2,3)</code>. And also it's not possible to parse produced string with e.g. Jackson with <code>objectMapper.readValue(li1.toString(), String[].class);</code>, which would be that one line solution.</p>