ServiceOne.java
private void doStuff(){}
ServiceTwo.java
private void doStuff()
Where to put common code ?
Shall I create a new service, but then what interface will it implement ?
Or shall I just create a utility class ? Please guide on what is the best approrach.
void
method, it probably relies on some functionality within the class. Beware if you can successfully abstract this information before you try to refactor your method. Just a similar name may not infer an identical implementation. I mean, there are a lot of implementations oftoString()
.doStuff
methods are exactly identical.