Java, Unit Testing, Legacy Code, Programming, Technology.
Utils.calculate(5)).thenReturn(10); int result = Utils.calculate(5); assertEquals(10, result); mockedStatic.verify(() -> Utils.calculate(5)); } } } In this example, Mockito.mockStatic is used to create a mock of the Utils class's static method calculate. The test verifies that the mocked method