private synchronized <ParametersT extends Parameters> Key createKeyFromRandomnessTyped(
      ParametersT parameters,
      InputStream inputStream,
      @Nullable Integer idRequirement,
      SecretKeyAccess access)
      throws GeneralSecurityException {
    Class<?> parametersClass = parameters.getClass();
    InsecureKeyCreator<?> creator = creators.get(parametersClass);
    if (creator == null) {
      throw new GeneralSecurityException(
          "Cannot use key derivation to derive key for parameters "
              + parameters
              + ": no key creator for this class was registered.");
    }
    @SuppressWarnings("unchecked") // We know we only insert like this.
    InsecureKeyCreator<ParametersT> castCreator = (InsecureKeyCreator<ParametersT>) creator;
    return castCreator.createKeyFromRandomness(parameters, inputStream, idRequirement, access);
  }
Creates a {@link Key} from a given {@link Parameters} object and additional data.

<p>Finds the previously added creator (with {@link #add}) for the class given by {@code
parameters.getClass()} and uses it.
java_src/src/main/java/com/google/crypto/tink/internal/MutableKeyDerivationRegistry.java