Last active
September 7, 2022 13:07
-
-
Save maartenl/ba132afd423e3678e64af5e3817e25f9 to your computer and use it in GitHub Desktop.
use ?.<operator> to fix the problem
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* use "?.let" to create a lambda in which we're sure there's no problem. | |
* Is a very nice solution, if possible. | |
*/ | |
@Test | |
fun mutablePropertyCouldHaveChanged4() { | |
name?.let { assertThat(it.length).isNotZero() } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment