I just saw a piece of code that had some classes with only one method. I picked an examples:
public class TempDirCleanupProcess {
public void cleanup(final File directory) {}
}
Then, later on in the code the method was called the following way:
new TempDirCleanupProcess().cleanup(tempDir);
Now I am wondering if this is a bad practice because I have seen such "behavior" only with static methods before. Any oppinions on that?