title: Check for specific element in a map in Drools
body: <p>I want to access map key and compare to value that contains or not.</p>
  
  <p>//The Attribute class contains one map in the form of key and multiple values    </p>
  
  <pre><code>public class Attribute {
      private Map&lt;String, List&lt;String&gt;&gt; mapAttribute;
  
      public Map&lt;String, List&lt;String&gt;&gt; getMapAttribute() {
          return mapAttribute;
      }
  
      public void setMapAttribute(Map&lt;String, List&lt;String&gt;&gt; mapAttribute) {
          this.mapAttribute = mapAttribute;
      } 
  }
  
   public class DroolsMain {
  
          public static Attribute attribute = new Attribute();
  
          public static void main(String[] args) throws DroolsParserException, IOException {
  
          Map&lt;String, List&lt;String&gt;&gt; map = new HashMap&lt;String, List&lt;String&gt;&gt;();  
  
          List&lt;String&gt; listSubject = new ArrayList&lt;String&gt;(); 
          listSubject.add("email1");
          listSubject.add("email2");
          map.put("Subject", listSubject);
  
          List&lt;String&gt; listFrom = new ArrayList&lt;String&gt;(); 
          listFrom.add("Sathish Kumar");
          map.put("From", listFrom);
  
          attribute.setMapAttribute(map);
      }
  //...
  workingMemory.insert(attribute);
  }
  </code></pre>
  
  <p>Rules.drl</p>
  
  <pre><code>rule "Get Subject key: with particular value"  
     when
          attribute : Attribute($mapAttribute : mapAttribute) 
         //I want to compare value of **"Subject"**  
          List( this.contains( "email1")) from $mapAttribute.get("Subject")
  
       then
          System.out.println("Rule run successfully Getting key with particular value");
  
      end
  </code></pre>
  
  <p>I didn't get the value in Rule.drl. It shows not match any rule. so please help to find the value. </p>