Here is a notation rule used in Java code: a bracket should either start/end a line or be paired on the same line.
The notation applies universally to any programming language (incl. Java, Ruby, Python, C++, PHP, etc.) where brackets are used for method/function calls.
Here is how your code will look, if you follow this “Paired Brackets” notation:
new Foo( // ends the line
Math.max(10, 40), // open/close at the same line
String.format(
"hello, %s",
new Name(
Arrays.asList(
"Jeff",
"Lebowski"
)
)
) // starts the line
);
Obviously, the line with a closing bracket should start at the same indentation level as the line with its opening pair.