public final T get() {
        T val = this.value;

        // double checked locking
        if (val == null) {
            synchronized (this) {
                val = this.value;
                if (val == null) {
                    val = supply();
                    this.value = val;
                }
            }
        }

        return val;
    }
Simple one element cache implementation.

@param <T> the type being stored
common/src/main/java/me/lucko/luckperms/common/cache/Cache.java