title: How do I say that an object is present in a Set that also has a treeset?
body: <p>I have s set of object <code>A</code>.</p>
  
  <pre><code>Class A {
  
      String text1;
      String text2
      TreeSet&lt;ClassAA&gt; classAaSet;
      @Override 
      public boolean equals(object b){
  
      }
      @Override 
      public int hashCode(){
  
      }
  }
  </code></pre>
  
  <p>The other class:</p>
  
  <pre><code>Class AA {
      String y;
      String z;
  
      @Override
      public int hashCode() {
          return Objects.hash(y,z)
      }
  
      @Override
      public int compareTo(ClassAA other) {
          return y.compareTo(other.y)
      }
  }
  </code></pre>
  
  <p>I have a set of A's and a single Object <code>A</code>.
  How do i <code>Set&lt;A&gt;aSet.contains(A)</code>?</p>
  
  <p>Internally, since i have a treeset, its ignoring the equals implementation.</p>