Java, Unit Testing, Legacy Code, Programming, Technology.
a + b; } } Write a characterization test to capture the current behavior: public class CalculatorTest { @Test public void testAdd() { Calculator calculator = new Calculator(); // Verify the existing behavior assertEquals(5, calculator.add(2, 3)); assertEquals(-1, calculator.add(2, -3));