void () { String source = """ class A<X, Y> {} class B {{ A<Integer, String> a1 = new A<>(); A<Integer, String> a2 = new A<Integer, String>(); A<Double, Boolean> a3 = new A<>(); A<Double, Boolean> a4 = new A<>(); }}"""; assertEquals("find diamond new expressions", 3, findMatchesCount(source, "new A<>()")); assertEquals("find parameterized new expressions", 2, findMatchesCount(source, "new A<Integer, String>()")); assertEquals("find non-diamond", 1, findMatchesCount(source, "new A<'_p{1,100}>()")); }