class PackageBasedClassFinder {

    public <T> Class<? extends T> findFirstOf(final Class<T> interfaceOrClass, final String packageName) throws ClassNotFoundException {
        Class<? extends T> result = null;
        Set<Class<? extends T>> classesThatImplementTheInterface = packageBasedClassFinderCore.find(packageName, interfaceOrClass);
        Iterator<Class<? extends T>> iterator = classesThatImplementTheInterface.iterator();
        if (iterator.hasNext()) {
            result = getResult(iterator);
        } else {
            throw new ClassNotFoundException(String.format(CLASS_NOT_FOUND_TEMPLATE, interfaceOrClass.getName(), packageName));
        }
        warnOfMultipleClasses(classesThatImplementTheInterface, packageName, interfaceOrClass);
        return result;

    }

}