Java, Unit Testing, Tdd, Programming, Technology.
MathUtils(); int result = mathUtils.add(2, 3); assertEquals(5, result); } } By extracting the sum method into a MathUtils class, you can test it directly. This makes your tests more focused and your code more modular. Using Inner Classes for Testing Another approach is to use inner classes for