What is interesting in your example is the use of parameterized types. Usually you'd have
interface Command {
public T execute(T someObject);
}
In your case you only have T
as a return value. Nevertheless using Void in this case is a good solution. The return value should be null
.