The thing you are worried about is micro-optimization and premature optimization.
Rather than worrying about this, I would suggest taking the readability and maintainability of the code more into consideration.
If there are more than two if/else blocks glued together or its size is unpredictable, then go for a switch statement.
As an alternate solution, you can also use Polymorphism.
For that, first create some interface:
public interface Test { void execute(String input); }
And get hold of all implementations in some Map. You can do this either statically or dynamically:
Map<String, Test> test= new HashMap<String, Test>();
Finally, replace the if/else or switch by something like this (leaving trivial checks like null pointers aside):
test.get(name).execute(input);
It might be micro slower than if/else or switch, but the code is at least far better maintainable.