Here you can find the source of getConstructors(Class
public static <T> Set<Constructor<T>> getConstructors(Class<T> clazz)
//package com.java2s; //License from project: Open Source License import java.lang.reflect.Constructor; import java.util.LinkedHashSet; import java.util.Set; public class Main { public static <T> Set<Constructor<T>> getConstructors(Class<T> clazz) { return createConstructorList(clazz.getConstructors()); }//from www . ja v a2s .c om @SuppressWarnings("unchecked") private static <T> Set<Constructor<T>> createConstructorList(Constructor<?>... constructors) { Set<Constructor<T>> ctors = new LinkedHashSet<>(constructors.length); for (Constructor<?> ctor : constructors) { ctors.add((Constructor<T>) ctor); } return ctors; } }