title: Inheritance from Java class with a public method accepting a protected class in Kotlin
body: <p>I have this situation:
  There are a Java class </p>
  
  <pre><code>public class A {
  
      public void overrideMe(B param){
          //TODO: override me in Kotlin!
      }
  
      protected static class B {
  
      }
  }
  </code></pre>
  
  <p>and a Kotlin class, which inherits from it and has to override method "overrideMe"</p>
  
  <pre><code>class K: A() {
      override fun overrideMe(param: B) {
          println("Wow!")
      }
  }
  </code></pre>
  
  <p>But Kotlin doesn't allow this behaviour.</p>
  
  <blockquote>
    <p>'public' function exposes its 'protected (in A)' parameter type B</p>
  </blockquote>
  
  <p>Is there any way how to resolve this one?</p>
  
  <p>P.S. It's not just a synthetic case - I faced this problem when I tried to implement custom <a href="https://docs.spring.io/spring-amqp/api/org/springframework/amqp/rabbit/logback/AmqpAppender.html" rel="noreferrer">Spring AmqpAppender</a> and to override it's postProcessMessageBeforeSend method.</p>