I have been reading Effective Java and I have some concerns regarding the first Item "use static factory method instead of constructor" in relation to TDD and dependency injection.
The item says that you should avoid having public/protected/default constructor and expose it using static factory. I agree with all the advantages related to using static factories like factories can have name, you can return subtype, you can reduce verbosity etc. But, I think in disadvantages Joshua missed TDD because having static factories in your code will lead to tight coupling and you can't mock the class using it. We will not be able to mock the class which will be having static factories. So, it hampers test driven development.
Second point, I think he missed that in todays enterprise development most of the applications use one or another dependency injection container. So, when we can inject dependencies using DI so why should I use it.
Please explain how it applies to today's Java enterprise development which includes DI and TDD.