Update TestClass.java

Added Exception Handling