Question: So, I have a JSON file that looks like this ;

```
 {
    "data": { stuff that i need }
    "stuff not needed": {more stuff not needed}
    "data": {more stuff that i need}
 }

```

In short, the stuff that I need is inside the curly braces of the "data" key. How can I print this in a Linux shell command? Note, there are several "data" objects in my file, and I would like to extract data from all of them each one at a time.

The intended output
 would be like this 

```
data {...}
data {...}

```

Answer: 
'Extension' in the context of the Open Closed Principle usually does not mean inheritance, it means somehow extending the class with new functionality. 'Modification' does refer to changing the code of the class, as you say.

The extension facility of Kotlin allows you to add a method to a class without editing the code of the class. This is perfectly in keeping with the Open Closed Principle -- the class is extended with new functionality without the class itself being changed.
The extenstion function is designed for situations where you want to add a function to a built-in or third-party class. You cannot do this by default because built-in functions are not modifiable.

An example implementation to add a toUnsigned method to the built-in Byte class:

```
fun Byte.toUnsigned(): Int {
    return if (this < 0) this + 256 else this.toInt()
}

```

As Byte is a built-in class you cannot modify it directly. However, you can define an extension function as per above code. You can then call the extension function in the following way:

```
val x: Byte = -1
println(x.toUnsigned()) // Prints 255

```

Keep in mind that this is just syntactic sugar - you're not actually modifying the class or its instances. Therefore, you have to import an extension function/property wherever you want to use it (since it isn't carried along with the instances of the class).

Source : <https://kotlinlang.org/docs/tutorials/kotlin-for-py/extension-functionsproperties.html>