int (final String loaderName) { Integer loaderId = null; for (int i = 0; ; i++) { if (!mLoaderIds.containsValue(i)) { loaderId = i; mLoaderIds.put(loaderName, loaderId); break; } } return loaderId; // here IDEA says that "unboxing may produce NPE". }