title: IntelliJ Structural Search to find classes that implement A but not B
body: <p>I'm trying to use IntelliJ 10.5's "structural search" feature to find classes that implement an interface, <em>A</em> but do not implement another interface, <em>B</em>. </p>
  
  <p>By searching first for classes that implement <em>A</em>, and then limiting the search scope to 'previous search results,' it's easy to reduce this to just searching for classes that do not implement <em>B</em>, which is conceptually pretty simple. Unfortunately, I haven't yet managed to pull it off.</p>
  
  <p>If I search for</p>
  
  <pre><code>class $clazz$ implements $B$ {}
  </code></pre>
  
  <p>and then tick 'invert condition' in the text constraints for variable B, it seems to find 'all classes that implement something other than <em>B</em>' even if they also implement <em>B</em>. I've also tried ticking 'invert condition' on the 'complete match' variable, and its effect is not immediately obvious, but definitely not what I'm looking for.</p>
  
  <p>Inicidentaly, someone else asked <a href="http://devnet.jetbrains.net/message/5275370" rel="noreferrer">a similar question</a> on the IntelliJ forums, but got no love. Help me out, stackoverflow!</p>