void (@NotNull ActionContext context, @NotNull PsiField field, @NotNull ModPsiUpdater updater) { PsiElementFactory factory = JavaPsiFacade.getElementFactory(context.project()); Application application = ApplicationManager.getApplication(); Random random = application.isUnitTestMode() ? new Random(42) : new SecureRandom(); PsiExpression newInitializer = factory.createExpressionFromText(random.nextLong() + "L", null); PsiExpression initializer = field.getInitializer(); if (initializer != null) { new CommentTracker().replaceAndRestoreComments(initializer, newInitializer); } else { field.setInitializer(newInitializer); } }