void (String classOrResourceName, Iterable<String> originatingClassnames) { if (classOrResourceName != null) { Collection<String> names = null; for (String cn : originatingClassnames) { if (names == null) { names = myGeneratedToOriginatingMap.get(classOrResourceName); if (names == null) { myGeneratedToOriginatingMap.put(classOrResourceName, names = new HashSet<>()); } } names.add(cn); } } }