Inheritance from Java class in Kotlin

I have this situation:
There are a Java class

public class A {

    public void overrideMe(B param){
        //TODO: override me in Kotlin!

    protected static class B {


and a Kotlin class, which inherits from it and has to override method “overrideMe”

class K: A() {
    override fun overrideMe(param: B) {

But Kotlin doesn’t allow this behaviour.

‘public’ function exposes its ‘protected (in A)’ parameter type B

Is there any way how to resolve this one?

P.S. It’s not just a synthetic case – I faced this problem when I tried to implement custom Spring AmqpAppender and to override it’s postProcessMessageBeforeSend method.