bson/src/main/org/bson/Document.java
public <T> T getEmbedded(final List<?> keys, final Class<T> clazz) {
        notNull("keys", keys);
        isTrue("keys", !keys.isEmpty());
        notNull("clazz", clazz);
        return getEmbeddedValue(keys, clazz, null);
    }
public <T> T getEmbedded(final List<?> keys, final Class<T> clazz) {
        notNull("keys", keys);
        isTrue("keys", !keys.isEmpty());
        notNull("clazz", clazz);
        return getEmbeddedValue(keys, clazz, null);
    }
public < T > T getEmbedded ( final List < ? > keys , final Class < T > clazz ) { notNull ( "keys" , keys ) ; isTrue ( "keys" , ! keys . isEmpty ( ) ) ; notNull ( "clazz" , clazz ) ; return getEmbeddedValue ( keys , clazz , null ) ; }
Gets the value in an embedded document, casting it to the given {@code Class<T>}.  The list of keys represents a path to the
embedded value, drilling down into an embedded document for each key. This is useful to avoid having casts in
client code, though the effect is the same.

The generic type of the keys list is {@code ?} to be consistent with the corresponding {@code get} methods, but in practice
the actual type of the argument should be {@code List<String>}. So to get the embedded value of a key list that is of type String,
you would write {@code String name = doc.getEmbedded(List.of("employee", "manager", "name"), String.class)} instead of
{@code String name = (String) doc.get("employee", Document.class).get("manager", Document.class).get("name") }.

@param keys  the list of keys
@param clazz the non-null class to cast the value to
@param <T>   the type of the class
@return the value of the given embedded key, or null if the instance does not contain this embedded key.
@throws ClassCastException if the value of the given embedded key is not of type T
@since 3.10
Gets the value in an embedded document casting it to the given { @code Class<T > } . The list of keys represents a path to the embedded value drilling down into an embedded document for each key . This is useful to avoid having casts in client code though the effect is the same .