def myassert(cond : => Boolean) = { try { assert(cond) } catch { case _ : Throwable => System.exit(1) } } myassert(get_delta(None, None) == None) myassert(get_delta(Some(50.0), None) == None) myassert(get_delta(None, Some(100.0)) == None) myassert(get_delta(Some(50.0), Some(100.0)) == Some(1.0))