Use Long.parseLong() instead since it returns long rather than Long.