title: Map collection elements and keep reference to source collection
body: <p>I'm looking for a way to create a collection, list, set, or map which contains the transformed elements of an original collection and reflects every modification in that collection.</p>
  
  <p>For example if I have a <code>List&lt;Integer&gt;</code> from a third party API and another API is expecting a <code>List&lt;String&gt;</code>. I know I can transform the list like this:</p>
  
  <pre><code>List&lt;Integer&gt; intList = thirdPartyBean.getIntListProperty();
  List&lt;String&gt; stringList = intList.stream().map(Integer::toString)
      .collect(Collectors.toList());
  secondBean.setStringListProperty(stringList);
  </code></pre>
  
  <p>The problem is, if anything is changed in one of the lists the other one will still reflect the previous state. Let's assume that <code>intList</code> contains <code>[1, 2, 3]</code>:</p>
  
  <pre><code>intList.add(4);
  stringList.remove(0);
  System.out.println(intList.toString()); // will print: [1, 2, 3, 4]
  System.out.println(stringList.toString()); // will print: [2, 3]
  // Expected result of both toString(): [2, 3, 4]
  </code></pre>
  
  <p>So I'm searching for something like <code>List.sublist(from, to)</code> where the result is "backed" by the original list.</p>
  
  <p>I'm thinking of implementing my own list wrapper which is used like this:</p>
  
  <pre><code>List&lt;String&gt; stringList = new MappedList&lt;&gt;(intList, Integer::toString, Integer::valueOf);
  </code></pre>
  
  <p>The second lambda is for inverting the conversion, to support calls like <code>stringList.add(String)</code>.</p>
  
  <p>But before I implement it myself I would like to know if I try to reinvent the wheel - maybe there is already a common solution for this problem?</p>