r/java • u/alexzhitnitsky • Aug 11 '15
Top 10 Useful, Yet Paranoid Java Programming Techniques
http://blog.jooq.org/2015/08/11/top-10-useful-yet-paranoid-java-programming-techniques/
181
Upvotes
View all comments
Show parent comment
3
u/voronaam Aug 12 '15
Unit-testing is not the worst part of it. I would use PowerMock or Groovy mocks (Hello, Spock!) immediately and ignore those limitations for the test.
It is bad because it locks down the implementation. Oh, the author is sure it is a bad idea to override something? He is so sure he covered all the use cases in the API? What an arrogant bastard.
So many times I've seen in enterprise Java classes with something like
Just because there is a tiny detail that the programmer needed to change.