In Java, the programmer can specify expected exceptions for JUnit test cases like this:
@Test(expected = ArithmeticException.class) public void omg() { int bl
You can also use generics with kotlin.test package:
import kotlin.test.assertFailsWith @Test fun testFunction() { assertFailsWith { // The code that will throw MyException } }