title: java stream make map after two different filters
body: <p>It should return a Map.
  Keys of this Map should be the Strings &quot;transversion&quot; and &quot;transition&quot;, and the values of the Map should be lists of SNP objects. &quot;Transitions&quot; are changes between A&lt;-&gt;G and C&lt;-&gt;T and &quot;transversions&quot; are changes A&lt;-&gt;C, G&lt;-&gt;T, A&lt;-&gt;T and C&lt;-&gt;G.</p>
  <p>How should I make the two filters?</p>
  <pre><code>public class StreamAssignment {
  
      private static final List&lt;Snp&gt; SNP_COLLECTION = Snp.getSnpCollection();
      private static final String[] SNP_DATA = new String[14];
  
      static {
          SNP_DATA[0] = &quot;100273;A;G;0.0123&quot;;
          SNP_DATA[1] = &quot;100275;A;C;0.00323&quot;;
          SNP_DATA[2] = &quot;117807;T;G;0.1915&quot;;
          SNP_DATA[3] = &quot;162889;C;G;8.72E-4&quot;;
          SNP_DATA[4] = &quot;190199;T;C;0.1019&quot;;
          SNP_DATA[5] = &quot;277614;A;G;0.0168&quot;;
          SNP_DATA[6] = &quot;372778;C;A;4.24E-5&quot;;
          SNP_DATA[7] = &quot;417752;A;G;1.8474E-10&quot;;
          SNP_DATA[8] = &quot;478808;A;G;1.535689E-8&quot;;
          SNP_DATA[9] = &quot;556920;T;G;0.1097&quot;;
          SNP_DATA[10] = &quot;676255;G;C;0.0016672&quot;;
          SNP_DATA[11] = &quot;667280;A;G;0.00287&quot;;
          SNP_DATA[12] = &quot;719876;C;A;0.006649&quot;;
          SNP_DATA[13] = &quot;828771;A;C;0.097706&quot;;
      }
  
      public static Map&lt;String, List&lt;Snp&gt;&gt; getTransversionsTransitions() {
          Map&lt;String, List&lt;Snp&gt;&gt; result;
          result = SNP_COLLECTION.stream().filter();
  
  
          return null;
      }
  }
  </code></pre>
  <p>snp class</p>
  <pre><code>package nl.bioinf.appdesign.d_streams_lambdas;
  
  import java.util.ArrayList;
  import java.util.List;
  
  public class Snp {
      private final long position;
      private final char reference;
      private final char alternative;
      private final double minorAlleleFrequency;
  
      public Snp(long position, char reference, char alternative, double minorAlleleFrequency) {
          this.position = position;
          this.reference = reference;
          this.alternative = alternative;
          this.minorAlleleFrequency = minorAlleleFrequency;
      }
  
      public long getPosition() {
          return position;
      }
  
      public char getReference() {
          return reference;
      }
  
      public char getAlternative() {
          return alternative;
      }
  
      public double getMinorAlleleFrequency() {
          return minorAlleleFrequency;
      }
  
      @Override
      public String toString() {
          return &quot;Snp{&quot; +
                  &quot;position=&quot; + position +
                  &quot;, reference=&quot; + reference +
                  &quot;, alternative=&quot; + alternative +
                  &quot;, minorAlleleFrequency=&quot; + minorAlleleFrequency +
                  '}';
      }
  
      public final static List&lt;Snp&gt; getSnpCollection() {
          List&lt;Snp&gt; snps = new ArrayList&lt;&gt;();
          snps.add(new Snp(100273, 'A', 'G', 0.0123));
          snps.add(new Snp(100275, 'A', 'C', 0.00323));
          snps.add(new Snp(117807, 'T', 'G', 0.1915));
          snps.add(new Snp(162889, 'C', 'G', 0.000872));
          snps.add(new Snp(190199, 'T', 'C', 0.1019));
          snps.add(new Snp(277614, 'A', 'G', 0.0168));
          snps.add(new Snp(372778, 'C', 'A', 0.0000424));
          snps.add(new Snp(417752, 'A', 'G', 1.8474e-10));
          snps.add(new Snp(478808, 'A', 'G', 1.535689e-8));
          snps.add(new Snp(556920, 'T', 'G', 0.1097));
          snps.add(new Snp(676255, 'G', 'C', 1.6672e-3));
          snps.add(new Snp(667280, 'A', 'G', 0.00287));
          snps.add(new Snp(719876, 'C', 'A', 0.006649));
          snps.add(new Snp(828771, 'A', 'C', 0.097706));
          return snps;
      }
  }
  </code></pre>