}
final Statement firstStatement = node.getStatements().firstOrNullObject();
if (firstStatement instanceof BlockStatement) {
final BlockStatement block = (BlockStatement) firstStatement;
final boolean declaresVariables = any(
block.getStatements(),
new Predicate<Statement>() {
@Override
public boolean test(final Statement s) {
return s instanceof VariableDeclarationStatement;
}
}
);
if (!declaresVariables) {
block.remove();
block.getStatements().moveTo(node.getStatements());
}
}
return super.visitSwitchSection(node, _);
}