Started converting C# to java