## With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

No credit card required

# Requirement – single operations

So, the plan is to support add, subtract, multiply and divide operations. As explained in the kata presentation, in RPN the operator is located at the end of the expression.

That means a - b is represented as a b -, and the same applies to the other operators: addition +,  multiplication *,  and division /.

Let's add one of each of the supported operations to our tests:

`@Testpublic void addOperationReturnsCorrectValue() {  assertThat(reversePolishNotation.compute("1 2 +")).isEqualTo(3);}@Testpublic void subtractOperationReturnsCorrectValue() {  assertThat(reversePolishNotation.compute("2 1 -")).isEqualTo(1);}@Testpublic void multiplyOperationReturnsCorrectValue() { assertThat(reversePolishNotation.compute("2 ...`

## With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

No credit card required