Second encounter

Not that much difficult, the second encounter introduces some more advanced features.

Infix

Kotlin supports infix syntax. That’s it.

Definition of done: Make InfixSpec test pass (without comments).

Lazy

Another simple task - explore the usage of lazy loading and delegated properties.

Definition of done: Make LazySpec test pass.

Reference: https://kotlinlang.org/docs/reference/delegated-properties.html

Ranges

Implement rangeTo function in MyDate class so that you’re able to use .. operator. Then implement checkInRange method that should check whether date is within (first, last) range.

Definition of done: Make DateRangeSpec test pass.

Reference: https://kotlinlang.org/docs/reference/ranges.html

The “cat’s dead baby, cat’s dead…”

You’ve ever used switch on an enum and had to define default like I don't know what to do know, throw an exception I guess? because that’s how you do it in Java? Well that’s what sealed classes are for (too).

Definition of done: Refactor SchrodingersCat to a sealed class and refactor SchrodingersCatSpec test so that it passes.

Reference: https://kotlinlang.org/docs/reference/classes.html#sealed-classes

Topics:

Second encounter

Not that much difficult, the second encounter introduces some more advanced features.

Infix

Kotlin supports infix syntax. That’s it.

Definition of done: Make InfixSpec test pass (without comments).

Lazy

Another simple task - explore the usage of lazy loading and delegated properties.

Definition of done: Make LazySpec test pass.

Reference: https://kotlinlang.org/docs/reference/delegated-properties.html

Ranges

Implement rangeTo function in MyDate class so that you’re able to use .. operator. Then implement checkInRange method that should check whether date is within (first, last) range.

Definition of done: Make DateRangeSpec test pass.

Reference: https://kotlinlang.org/docs/reference/ranges.html

The “cat’s dead baby, cat’s dead…”

You’ve ever used switch on an enum and had to define default like I don't know what to do know, throw an exception I guess? because that’s how you do it in Java? Well that’s what sealed classes are for (too).

Definition of done: Refactor SchrodingersCat to a sealed class and refactor SchrodingersCatSpec test so that it passes.

Reference: https://kotlinlang.org/docs/reference/classes.html#sealed-classes