MavenProject (int id) { Reference<RemoteNativeMaven3ProjectHolder> reference = myMap.get(id); RemoteNativeMaven3ProjectHolder result = reference == null ? null : reference.get(); if (result == null) { throw new RuntimeException("NativeMavenProjectHolder not found for id: " + id); } return result.myMavenProject; }