Sub AvailableCharacterSets As List
'Create the output list
Dim L As List
L.Initialize
'Initialize CSet to the static class Charset
Dim CSet As JavaObject
CSet.InitializeStatic("java.nio.charset.Charset")
'Get an immutable ordered map of available character sets
Dim CSetMap As JavaObject = CSet.RunMethod("availableCharsets",Null)
'Get the keys from the Map as a Set
Dim Keys As JavaObject = CSetMap.RunMethod("keySet",Null)
'Get an iterator for the set
Dim Iterator As JavaObject = Keys.RunMethod("iterator",Null)
'Loop through the Keys Set and add each item to the output list
Do While Iterator.RunMethod("hasNext",Null)
L.Add(Iterator.RunMethod("next",Null))
Loop
Return L
End Sub