Technical debt and fix JUnit test