my $hm = HashMap->new(); #instead of my $hm = java::util::HashMap->new();