class DefaultResourceManager implements ResourceManager {

    @Override
    public URL getResource(String location) throws MalformedURLException {
        URL result = null;
        Iterator<Resource> iterator = resources.iterator();
        while (iterator.hasNext()) {
            Resource resource = iterator.next();
            result = resource.getResource(location);
            if (result != null) {
                break;
            }
        }
        if (result == null) {
            if (location != null) {
                result = getClass().getResource(location);
            }
        }
        return result;
    }

}