@Override public void visitNode(Tree tree) { SwitchStatementTree switchStatementTree = (SwitchStatementTree) tree; CaseLabelTree defaultLabel = getDefaultLabel(switchStatementTree); CaseLabelTree lastLabel = getLastLabel(switchStatementTree); if (defaultLabel == null) { reportIssue(switchStatementTree.switchKeyword(), "Add a default case to this switch."); } else if (!defaultLabel.equals(lastLabel)) { reportIssue(defaultLabel, "Move this default to the end of the switch."); } }