private static @Nullable TailType getTailType(boolean smart, boolean inSwitchLabel, PsiElement position) {
    if (!smart && inSwitchLabel) {
      if (position instanceof PsiClass) {
        return TailTypes.insertSpaceType();
      }
      return JavaTailTypes.forSwitchLabel(Objects.requireNonNull(PsiTreeUtil.getParentOfType(position, PsiSwitchBlock.class)));
    }
    if (!smart && shouldInsertSemicolon(position)) {
      return TailTypes.semicolonType();
    }
    return null;
  }
private static @Nullable TailType getTailType(boolean smart, boolean inSwitchLabel, PsiElement position)