StringCalculator without java 8