Returns an unmodifiable collection which may be empty, but is never null.
(Map<String, Collection<T>> map, String key)
| 173 | |
| 174 | /** Returns an unmodifiable collection which may be empty, but is never null. */ |
| 175 | public static <T> Collection<T> valuesOrEmpty(Map<String, Collection<T>> map, String key) { |
| 176 | Collection<T> values = map.get(key); |
| 177 | return values != null ? values : Collections.emptyList(); |
| 178 | } |
| 179 | |
| 180 | public static void ensureClosed(Closeable closeable) { |
| 181 | if (closeable != null) { |
no test coverage detected