class DomainCache {

    /**
     * Domains.
     */
    private static final List<JSONObject> DOMAINS = new ArrayList<>();

    /**
     * Lock.
     */
    private static final ReadWriteLock LOCK = new ReentrantReadWriteLock();

    /**
     * Domain query service.
     */
    @Inject
    private DomainQueryService domainQueryService;

    /**
     * Gets domains with the specified fetch size.
     *
     * @param fetchSize the specified fetch size
     * @return domains
     */
    public List<JSONObject> getDomains(final int fetchSize) {
        LOCK.readLock().lock();
        try {
            if (DOMAINS.isEmpty()) {
                return Collections.emptyList();
            }

            final int end = fetchSize >= DOMAINS.size() ? DOMAINS.size() : fetchSize;

            return JSONs.clone(DOMAINS.subList(0, end));
        } finally {
            LOCK.readLock().unlock();
        }
    }

    /**
     * Loads domains.
     */
    public void loadDomains() {<FILL_FUNCTION_BODY>}
}

        LOCK.writeLock().lock();
        try {
            DOMAINS.clear();
            DOMAINS.addAll(domainQueryService.getMostTagNaviDomains(Integer.MAX_VALUE));
        } finally {
            LOCK.writeLock().unlock();
        }
    
<no_super_class>