title: How can I use guava FluentIterable to simplify Maps transformations?
body: <p>I often use <code>Map&lt;U,V&gt;</code> that I transform and filter to get another <code>Map&lt;U,V'&gt;</code>, but the transformation is horribly verbose, I saw <code>FluentIterable</code> class in the quesion <a href="https://stackoverflow.com/questions/4277734/guava-how-to-combine-filter-and-transform">Guava: how to combine filter and transform?</a>, is is possible to use it to simplify the following ? </p>
  
  <pre><code>public class GuavaTest {
  
      public static class A{
          int a;
          int b;
          int c;
          public A(int a, int b, int c){
              this.a=a; this.b=b; this.c=c;
          }
      }
  
      public static void main(String[] args) {
  
          //Example 2
          final Map&lt;String, A&gt; map =Maps.newHashMap();
  
          map.put("obj1",new A(1,1,1)); map.put("obj2",new A(1,2,1));
          map.put("obj3",new A(1,3,1)); map.put("obj4",new A(1,4,1));
  
          Function&lt;A, Integer&gt; function = new Function&lt;A, Integer&gt;() {
              @Nullable
              @Override
              public Integer apply(@Nullable A input) {
                  return input.b;
              }
          };
  
          Predicate&lt;Integer&gt; isPair = new Predicate&lt;Integer&gt;() {
              @Override
              public boolean apply(@Nullable Integer input) {
                  return input % 2 == 0;
              }
          };
  
          //Can I use FluentIterable here ??
          Map&lt;String, Integer&gt; stringIntegerMap = Maps.transformValues(map, function);
          Map&lt;String, Integer&gt; stringIntegerMap1 = Maps.filterValues(stringIntegerMap, isPair);
      }
  }
  </code></pre>