I am implementing simple guava CacheLoader as it is stated here
CacheLoader<Key, Graph> loader = new CacheLoader<Key, Graph>() {
public Graph load(Key key) throws AnyException {
return createExpensiveGraph(key);
}
};
LoadingCache<Key, Graph> cache = CacheBuilder.newBuilder().build(loader);
Does this mean that I should create my own exception class and throw it if the value is null or is there any better way to hande the situation?