title: Java calling method and using ternary operator and assign in the parameters?
body: <p>I was reviewing some code and I came across this:</p>
  
  <pre><code> public static doSomething(String myString, String myString2) {
          //Stuff
   }
  
   public static doAnotherThing(String myString) {
        return doSomething(myString = myString != null ? myString.toLowerCase(): myString, null)
   }
  </code></pre>
  
  <p>How is this working exactly?, I know the .toLowerCase resulting string is assigned to myString (yes I know bad practice since you are not supposed to reassign method parameters in fact they should be final), but I am not quite sure how does the method always receives the 2 parameters it needs.</p>
  
  <p>I know how it works when myString is null or at least I think I do, since the ternary has myString, null, but I am not quite sure why it would go there when myString is not null?.</p>