Powershell Select String Count Function In Java