Additional blank lines before each test case are part of input and should be skipped, instead of being produced by application with System.out.println()
.
In current version, plus and equal sign will not be found (because line is empty) and substring method will throw an exception.
Apart from this, it seems fine.