Replace removeSpace() with Strings builtin trim().