I am trying to avoid constructs like this:
val result = this.getClass.getSimpleName if (result.endsWith(\"$\")) result.init else result
Ok,
Since if-else constructions in Scala return a value, you can use this
val a = if (1 < 0) 1 else 2
More info: https://alvinalexander.com/scala/scala-if-then-ternary-operator-cookbook-examples