void (@NotNull String className, @NotNull final PsiType migrationType, final String... fieldNames) { final RulesProvider provider = new RulesProvider() { @Override public PsiType migrationType(PsiElement context) { return migrationType; } @Override public PsiElement[] victims(PsiClass aClass) { return Arrays .stream(fieldNames) .map(n -> aClass.findFieldByName(n, false)) .peek(TestCase::assertNotNull) .toArray(PsiElement[]::new); } }; start(provider, className); }