Question: Groovy can access private methods and variables of a Java class. How does Groovy do this behind the scene? Is it because of the use of `invokedynamic` bytecode instruction which is used by `MethodHandle` class? I think Java uses `invokespecial` instruction for calling `private` methods and `invokevirtual` for `public` right which respects access modifiers?

Answer: 
Groovy is written in Java, so it hopefully doesn't rely on the byte code directly, it doesn't it using the [Reflection API](https://docs.oracle.com/javase/tutorial/reflect/).

For more details check for [`java.lang.reflect`](https://github.com/groovy/groovy-core/search?utf8=%E2%9C%93&q=java.lang.reflect) in the source code, you will then see how it uses the Reflection API behind the scene.
you can use java.lang.reflect

```
import java.lang.reflect.Method

// ....

Method method = a.getClass().getDeclaredMethod('initializeSeoCode')
method.setAccessible(true)
java.lang.Object r = method.invoke(a)

```