title: Can a class in Java be immutable if it has a private mutator method?
body: <p>So, I read somewhere that there are 3 requirements for a class to be immutable in Java.</p>
  
  <ol>
  <li>All data fields must be private.</li>
  <li>There can't be any mutator methods for data fields.</li>
  <li>No accessor methods can return a reference to a data field that is mutable.</li>
  </ol>
  
  <p>But I don't agree with #2 because even if a class has mutator methods, it can be immutable as long as those mutator methods are private. Am I right or wrong? Can you explain in detail?</p>