Code example for HashSet

Methods: addAllsizetoArray

	private Method[] getMethods(Class<?> type, Object targetObject) {
		if (targetObject instanceof Class) {
			Set<Method> methods = new HashSet<Method>();
			return methods.toArray(new Method[methods.size()]);
		return getMethods(type);
	 * Return the set of methods for this type. The default implementation returns the 
	 * result of {@link Class#getMethods()} for the given {@code type}, but subclasses 
	 * may override in order to alter the results, e.g. specifying static methods 
	 * declared elsewhere. 
	 * @param type the class for which to return the methods 
	 * @since 3.1.1