I tried to write a method, is this method feasible?🤔
public List<V> getAllPresent(List<K> keys) {
List<V> result = Collections.emptyList();
if (keys != null && !keys.isEmpty()) {
result = new ArrayList<V>(keys.size());
for (K key : keys) {
V value = get(key);
if (value != null) {
result.add(get(key));
}
}
}
return result;
}
like caffeine getAllPresent
I tried to write a method, is this method feasible?🤔
Thanks for your reply.