public static function getUsersByGroup($groupId, $recursive = false)
	{
		$test = $recursive ? '>=' : '=';

		// First find the users contained in the group
		$db = App::get('db');
		$query = $db->getQuery()
			->select('DISTINCT(user_id)')
			->from('#__usergroups', 'ug1')
			->joinRaw('#__usergroups AS ug2', 'ug2.lft' . $test . 'ug1.lft AND ug1.rgt' . $test . 'ug2.rgt', 'inner')
			->join('#__user_usergroup_map AS m', 'm.group_id', 'ug2.id', 'inner')
			->whereEquals('ug1.id', $groupId);

		$db->setQuery($query->toString());

		$result = $db->loadColumn();

		// Clean up any NULL values, just in case
		Arr::toInteger($result);

		return $result;
	}