public synchronized void updateSubjectName(String oldSubjectName, String newSubjectName) {
        final List<EmbeddingProjection> projections = projection2Index.keySet()
                .stream()
                .filter(projection -> projection.subjectName().equals(oldSubjectName))
                .toList();

        projections.forEach(projection -> projection2Index.put(
                projection.withNewSubjectName(newSubjectName),
                projection2Index.remove(projection)
        ));
    }
NOTE: current method returns COPY! Each time you invoke it, memory consumed, be careful!

@return copy of underlying embeddings array.
java/api/src/main/java/com/exadel/frs/core/trainservice/cache/EmbeddingCollection.java