<p><pre><code>    I&#x27;d get comments like &quot;wouldn&#x27;t it be better if you made this (only used 
    once and very trivial) line of code a separate function?&quot; &quot;could you use 
    more classes?&quot;
</code></pre>
The trouble is that there is a cargo-cult belief in unit testing in the Java (and .Net) worlds. Everything must have a full suite of unit tests, even if it&#x27;s a one-off script. Therefore, in order to enable the mock objects needed for unit testing, you can&#x27;t have &quot;just&quot; a class. You have to have an interface, which that class then implements. If you have any non-trivial piece of functionality, it must be encapsulated into its own method, otherwise, how are you going to test it in isolation.<p>My belief is that it all stems from the fact that Java doesn&#x27;t have a REPL, so programmers use &quot;test-driven development&quot; to get the same level of interactivity from their code.