public void endVisit(JIfStatement x, Context ctx) {
JExpression expr = x.getIfExpr();
JStatement thenStmt = x.getThenStmt();
JStatement elseStmt = x.getElseStmt();
if (expr instanceof JBooleanLiteral) {
JBooleanLiteral booleanLiteral = (JBooleanLiteral) expr;
boolean boolVal = booleanLiteral.getValue();
if (boolVal && !isEmpty(thenStmt)) {
// If true, replace myself with then statement
ctx.replaceMe(thenStmt);
} else if (!boolVal && !isEmpty(elseStmt)) {
// If false, replace myself with else statement