public Optional<Credential> getFromUsernamePassword() {
    if (credentials != null
        && credentials.separate != null
        && credentials.separate.from != null
        && credentials.separate.from.usernamePassword != null) {
      return Optional.of(
          Credential.from(
              Verify.verifyNotNull(credentials.separate.from.usernamePassword.username),
              Verify.verifyNotNull(credentials.separate.from.usernamePassword.password)));
    }
    return Optional.empty();
  }
If configured, returns a {@link Credential} created from user configured "from"
username/password.

@return a optional Credential
jib-cli/src/main/java/com/google/cloud/tools/jib/cli/CommonCliOptions.java