code: public DeterministicKey deriveNextChild(ImmutableList<ChildNumber> parentPath, boolean relative, boolean createParent, boolean privateDerivation) {
          DeterministicKey parent = get(parentPath, relative, createParent);
          int nAttempts = 0;
          while (nAttempts++ < HDKeyDerivation.MAX_CHILD_DERIVATION_ATTEMPTS) {
              try {
                  ChildNumber createChildNumber = getNextChildNumberToDerive(parent.getPath(), privateDerivation);
                  return deriveChild(parent, createChildNumber);
              } catch (HDDerivationException ignore) { }
          }
          throw new HDDerivationException("Maximum number of child derivation attempts reached, this is probably an indication of a bug.");
      }
docs: Extends the tree by calculating the next key that hangs off the given parent path. For example, if you pass a
  path of 1/2 here and there are already keys 1/2/1 and 1/2/2 then it will derive 1/2/3.
  
  @param parentPath the path to the parent
  @param relative whether the path is relative to the root path
  @param createParent whether the parent corresponding to path should be created (with any necessary ancestors) if it doesn't exist already
  @param privateDerivation whether to use private or public derivation
  @return next newly created key using the child derivation funtcion
  @throws IllegalArgumentException if the parent doesn't exist and createParent is false.