add JUnit Test and delete some "throw exception"

some "throw exception" is not nessesary.