title: java.util.Collections$UnmodifiableRandomAccessList to Collections.singletonList
body: <p>How to I convert a <code>java.util.Collections$UnmodifiableRandomAccessList</code> to a <code>Collections.singletonList</code>?
  In a attempt to store session between two services, i found this, but I cant figure out the step in between.
  First get the cookie info that i need to set:</p>
  
  <pre><code>Map&lt;String, Collections&gt; headerInfo = (Map&lt;String, Collections&gt;)
   ((BindingProvider) port).getResponseContext()
                           .get(MessageContext.HTTP_RESPONSE_HEADERS);
  </code></pre>
  
  <p>Now I can get the cookie info i need; 
  If I do a </p>
  
  <pre><code>System.out.println(headerInfo.get("Set-Cookie"));
  </code></pre>
  
  <p>I get something like this </p>
  
  <pre><code>Set-Cookie=[PHPSESSID=rpsnc2g7o4ltbr6l9qus177p14; path=/];
  </code></pre>
  
  <p>Now I just need to do this:</p>
  
  <pre><code>((BindingProvider) port2).getRequestContext()
     .put(MessageContext.HTTP_REQUEST_HEADERS, 
        Collections.singletonMap("Cookie", Collections.singletonList(cookieValue)));
  </code></pre>
  
  <p>But I can not figure out how to get from
  <code>headerInfo.get("Set-Cookie")</code> to: <code>cookieValue</code></p>
  
  <p>This is the question I found the first part of my problems solution in Q: <br><a href="https://stackoverflow.com/questions/14699114/jax-ws-client-maintain-session-cookies-across-multiple-services">JAX-WS client: maintain session/cookies across multiple services</a> <br>(It might explain my problem a bit too)</p>