void () { new <warning descr="Class 'library.JavaClass' must not be extended">JavaClass</warning>() { }; new <warning descr="Interface 'library.JavaInterface' must not be implemented">JavaInterface</warning>() { }; new JavaNonExtendableNestedOwner.<warning descr="Class 'library.JavaNonExtendableNestedOwner.NonExtendableNested' must not be extended">NonExtendableNested</warning>() { }; new <warning descr="Class 'library.KotlinClass' must not be extended">KotlinClass</warning>() { }; new <warning descr="Interface 'library.KotlinInterface' must not be implemented">KotlinInterface</warning>() { }; new KotlinNonExtendableNestedOwner.<warning descr="Class 'library.KotlinNonExtendableNestedOwner.NonExtendableNested' must not be extended">NonExtendableNested</warning>() { }; //No warnings new JavaNestedClassOwner.NestedClass() { }; new KotlinNestedClassOwner.NestedClass() { }; new JavaMethodOwner() { @Override public void <warning descr="Method 'doNotOverride()' must not be overridden">doNotOverride</warning>() { } }; new KotlinMethodOwner() { @Override public void <warning descr="Method 'doNotOverride()' must not be overridden">doNotOverride</warning>() { } }; }