code: public void setFilterExists( final Set<String> attributeNames )
      {
          final StringBuilder sb = new StringBuilder();
          sb.append( "(&" );
  
          for ( final String name : attributeNames )
          {
              sb.append( "(" );
              sb.append( new FilterSequence( name, "*", FilterSequence.MatchingRuleEnum.EQUALS ) );
              sb.append( ")" );
          }
  
          sb.append( ")" );
  
          filter = sb.toString();
      }
docs: Set up an exists filter for attribute name.  Consider the following example.
  
  <table border="1"><caption>Example Values</caption>
  <tr><td><b>Value</b></td></tr>
  <tr><td>givenName</td></tr>
  <tr><td>sn</td></tr>
  </table>
  <p><i>Result</i></p>
  <code>(&amp;(givenName=*)(sn=*))</code>
  
  @param attributeNames A valid set of attribute names