title: Error in return type. Why?
body: <p>Eclipse says</p>
  
  <blockquote>
    <p>This method (findClientByPetsName) must return a result of type Client. </p>
  </blockquote>
  
  <p>I don't understand why and what to do.</p>
  
  <pre><code>public class Client{
  
      private final String name;
      private final Pet pet;
  
      public Client(String name, Pet pet){
          this.name = name;
          this.pet = pet;
      }
  
      public String getName(){
          return this.name;
      }
  
      public Pet getPet(){
          return this.pet;
      }
  }
  
  
  public class Clinic {
  
      /**
      * This class describes Clinic
      */
  
      private final Client[] clients;
  
      public Clinic(final int size){
          this.clients = new Client[size];
      }
  
      public Client findClientByPetsName (final String petsName){
          for(int i=0; i&lt;clients.length; i++) {
              if (clients[i].getPet().getName() == petsName)
                  return clients[i];
          }
      }
  }
  </code></pre>