How refactor two methods which are very similar
问题 I have following classes: public interface IBaseInterface { String baseMethod(); } public class BaseClass implements IBaseInterface{ @Override public String baseMethod() { return "baseInterface"; } public String otherBaseMethod(){ return "otherBaseMethod"; } } public class ClassA implements IBaseInterface{ @Override public String baseMethod() { return "ClassA"; } public String getAttribiuteA(){ return "A"; } } public class ClassB implements IBaseInterface { @Override public String baseMethod(