How to use java bluej to Write a method that takes a String parameter, and returns the integer that it represents.
The method should first check the String to make sure that it is not null, is not empty, and contains only valid characters for an integer. The first character may be a minus sign, to indicate a negative integer. All subsequent characters should be digits.