The C# with seems bit more restricted though because it uses object initializer syntax while Java has full-blown code block, so in Java you can put arbitrary statements in. Also in Java you get the original values in the with statement, which I don't see in C#.
Also C# records do not support initialization code so you can't validate arguments :(