Now, let's write a test for the multiplyByTwo() method of the SimpleMath class, because we would like to make sure that the multiplyByTwo() method works as expected. Such tests are useful as long as the project exists, because you can run them every time the code is changed, and verify that the existing functionality has not been changed accidentally.
A method is the smallest testable part of an application. That's why such a test is called a unit test. It is a good idea to have a unit test for each method that you create (except the trivial ones, such as getters and setters, for example).
We will use a popular test framework called JUnit. There are several versions of it. At the time of this writing, version 5 is the ...