Hi,
The code you have provided, does not conform to the rules for creating snippets in Subject7 platform.
Please see below article which illustrate how to create a snippet in our platform.
https://subject7.zendesk.com/hc/en-us/articles/360013098073-How-to-run-my-custom-Java-code-Snippet-
Regards,
Subject7 Team