NoClassDefFoundError on CI but works locally

Hi,
I have a problem with unit tests working locally but failing on CircleCi with errors like:

java.lang.NoClassDefFoundError: Could not initialize class org.mockito.Answers
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

and

java.lang.NoSuchMethodError: ‘org.mockito.internal.runners.InternalRunner org.mockito.internal.runners.RunnerFactory.createStrict(java.lang.Class)’
at org.mockito.junit.MockitoJUnitRunner.(MockitoJUnitRunner.java:154)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

and

java.lang.ExceptionInInitializerError
at org.mockito.internal.exceptions.stacktrace.ConditionalStackTraceFilter.(ConditionalStackTraceFilter.java:17)
at org.mockito.exceptions.base.MockitoException.filterStackTrace(MockitoException.java:41)
at org.mockito.exceptions.base.MockitoException.(MockitoException.java:30)

Has anyone run into similar problem and could help?