List<MavenArtifact> (@Nullable String groupId, @Nullable String artifactId, @Nullable String version) { Map<String, List<MavenArtifact>> groupMap = myData.get(groupId); if (groupMap == null) return Collections.emptyList(); List<MavenArtifact> artifacts = groupMap.get(artifactId); if (artifacts == null) return Collections.emptyList(); List<MavenArtifact> res = new SmartList<>(); for (MavenArtifact artifact : artifacts) { if (Objects.equals(version, artifact.getVersion())) { res.add(artifact); } } return res; }