title: interpolating missing dates into a map containing a list of dates
body: <p>Given a map  </p>
  
  <pre><code>Map&lt;String, List&lt;DateValue&gt;&gt; values;
  </code></pre>
  
  <p>DateValue is defined as:</p>
  
  <pre><code>class DateValue {
      Timestamp date;
      Double value;
  
      Timestamp getDate() { return this.date; }
      void setDate(Timestamp date) { this.date = date; }
      Double getValue() { return this.value; }
      void setValue(Double value) { this.value = value; }
  }
  </code></pre>
  
  <p>I want to normalise all the <code>List&lt;DateValue&gt;&gt;</code> lists in the map so that each <code>List&lt;DateValue&gt;</code> starts on the day of the minimum date (across the map), and each array has the same number of elements up to the maximum date (across the map).</p>
  
  <p>Each array has a zero value for each missing day in the range.</p>
  
  <pre><code>"A": [{ 1/1/2018: 2 }, { 4/1/2018: 10 }, { 10/1/2018: 11 }]
  "B": [{ 2/1/2018: 1 }, { 7/1/2018: 13 }, { 15/1/2018: 56 }]
  </code></pre>
  
  <p>Should result in:</p>
  
  <pre><code>"A": [
        { 1/1/2018: 2 }, { 2/1/2018: 0 }, { 3/1/2018: 0 },
       { 4/1/2018: 10 }, { 5/1/2018: 0 }, { 6/1/2018: 0 },
        { 7/1/2018: 0 }, { 8/1/2018: 0 }, { 9/1/2018: 0 },
      { 10/1/2018: 11 }, { 11/1/2018: 0 }, { 12/1/2018: 0 },
      { 13/1/2018: 11 }, { 14/1/2018: 0 }, { 15/1/2018: 0 },
  
  "B": [{1/1/2018: 0 }, { 2/1/2018:1 } ... { 15/1/2018: 56 }]
  </code></pre>
  
  <p>... and so on for "B". I could query the min and max values, and iterate whilst searching but it seems inefficient. For what it's worth the dates are sorted.</p>
  
  <p>Is it possible to do this with a set of <code>stream()</code> queries?</p>