Is there an utility method in Java that generates a list or array of a specified length with all elements equal to a specified value (e.g ["foo", "foo", "foo", "foo", "foo"])?
You can use Collections.nCopies. Note that this copies the reference to the given object, not the object itself. If you're working with strings, it won't matter because they're immutable anyway.
List<String> list = Collections.nCopies(5, "foo");
System.out.println(list);