Your code won't primarily work, because you are not passing an instancs as first parameter:
method.invoke(null,new Object[] { pri });
You need to pass object
as first parameter, not null
.
This should work:
List<Integer> pri = Arrays.asList(1,2,3,4);
Method method = object.getClass().getDeclaredMethod("setPri", List.class);
method.invoke(object, new Object[] { pri });