title: Practice to return itself instead void in Java
body: <p>My team mates introduce me to new practice writing method which will not return void.</p>
  
  <pre><code>public class Test {
     public Test doCalculations() {
        //code
        return this;
     }
     public Test appendTitle(String test) {
        //code
        return this;
     }
  }
  </code></pre>
  
  <p>Instead of returning void they suggest to return object itself. One of the advantage of this aproach they say, you can chain methods.</p>
  
  <p>Instead of writing:</p>
  
  <pre><code> while(1) {
      test.appendTitle("aaa");
      test.doCalculations();
      map.add(test);
   }
  </code></pre>
  
  <p>You can write more elegant code:</p>
  
  <pre><code> while(1) {
       map.add(test.appendTitle("aaa").doCalculations());
   }
  </code></pre>
  
  <p>What could be disadvantages of this aproach? Do you suggest to include it in daily use?</p>