Speculative Generality.
There’s an unused class, method, field or parameter.
##Signs and Symptoms
There’s an unused class, method, field or parameter.

interface PaymentFactoryProvider {
PaymentFactory factory(); // only one implementation exists
}
class CashProvider implements PaymentFactoryProvider {
public PaymentFactory factory() { return new CashFactory(); }
}##Reasons for the Problem
Sometimes code is created “just in case” to support anticipated future features that never get implemented. As a result, code becomes hard to understand and support.
##Treatment
##Payoff
-
Slimmer code.
-
Easier support.