Suppose we have this code:
class QuickExample { fun function(argument: SomeOtherClass) { if (argument.mutableProperty != null ) { doSome
i usually write it like this:
takeIf{somecondition}?.also{put somecondition is met code}?:run{put your else code here}
note the question mark after takeIf is a MUST. you can use also or apply keyword.