Unable to convert String to List in Java using RegEx...!
<p>I am trying to convert the below string to a list in Java, but its taking as a single object, I need four separate list obejcts.</p>

<p>String:
 button 1 of window "abc" of application process "xyz"
    button 2 of window "abc" of application process "xyz"
    button 3 of window "abc" of application process "xyz"
    button "Finish" of UI element 1 of scroll area 1 of window "abc" of application process "xyz"</p>

<p>Java code used:</p>

<pre><code>List&lt;String&gt; items = Arrays.asList(resultObject.toString().split("\\s*,\\s*"));
List&lt;String&gt; formattedList = new ArrayList&lt;String&gt;();
for (String item : items) {
    formattedList.add(item);                        
}
</code></pre>

<p>Expected Output:
similar to string but in four different list objects</p>

<pre><code>item1 : button 1 of window "abc" of application process "xyz"
item2 :button 2 of window "abc" of application process "xyz"
item3: button 3 of window "abc" of application process "xyz"
item4 :button "Finish" of UI element 1 of scroll area 1 of window "abc" of application process "xyz"
</code></pre>
