assertThrows syntax code example Example: assertThrows syntax assertThrows(classOf[UnsupportedOperationException], () => ...)