void () { final String in = """ class Util { @SafeVarargs @Contract(pure=true) public static <T> T @NotNull [] ar(T @NotNull ... elements) { return elements; } }"""; final String what = "$RT$ ar($T$ $p$);"; final String replacement = "$RT$ ar($T$ $p$);"; assertEquals("keep method type parameters", in, replace(in, what, replacement, true)); }