import lombok.experimental.ExtensionMethod; @ExtensionMethod({ExtensionMethodNonStatic.Extensions.class}) class ExtensionMethodNonStatic { static class Extensions { Extensions() { super(); } public boolean startsWith(String s, String prefix) { return s.startsWith(prefix); } } ExtensionMethodNonStatic() { super(); } public void test() { String s = "test"; s.startsWith(""); } }