import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; abstract class P2 { @NotNull String foo(@NotNull P p) { return ""; } } class PPP extends P2 { String foo(P p) { return super.foo(p); } } class PPP2 extends P2 { String foo(P p) { return super.foo(p); } } /////// in library interface Foo { @NotNull Object get(int i ); } class FooImpl extends java.util.ArrayList implements Foo { } interface I1 { @Nullable Object foo(); } interface I2 extends I1 { @NotNull Object foo(); } class A implements I1 { @Override public Object foo() { // returns something } } class B extends A implements I2 { } interface InheritorMethodOverriddenButParameterNot { @NotNull Integer get(@NotNull String param); } class InheritorMethodOverriddenButParameterNot_Impl implements InheritorMethodOverriddenButParameterNot { @NotNull @Override public Integer get(String param) { return 1; } }