code: public static Matcher<Map<String, Object>> hasAttribute(final String key, final Object value) {
      return new Matcher<Map<String, Object>>() {
  
        @Override
        protected boolean matchesSafely(Map<String, Object> object) {
          return object.containsKey(key) && value.equals(object.get(key));
        }
      };
    }
docs: Returns a matcher that matches attribute maps that include the given
  attribute entry.
  
  @param key   attribute name
  @param value attribute value
  @return a {@code Map<String, Object>} matcher