Object2IntMap<String> () { final Object2IntMap<String> map = new Object2IntOpenHashMap<>(); for (int i = 0; i < myAnnotationMethods.length; i++) { map.put(myAnnotationMethods[i].getName(), i); } return map; }