I understand the example a little from the example "Watching for 'alerts'" on this page: HtmlUnit- Javascript Tutorial. As a beginner in .NET, I do not understand how the Collections.singletonList works and I browse through the www that it is a function in Java. I am trying integrate this with validation where an alert box pops up when the user input is invalid. As a start I did write this first:
Dim alert As AlertHandler
webCLient.setAlertHandler(alert)
webCLient.getAlertHandler().handleAlert(page, "")
Found out that to use the singletonList, I had to completely put java.util.Collections.singletonList for it to work in .NET