Can I Assert And Throw A Function In Java