class ModelBuilderException extends MavenException {

    private final ModelBuilderResult result;

    /**
     * Creates a new exception from the specified interim result and its associated problems.
     *
     * @param result The interim result, may be {@code null}.
     */
    public ModelBuilderException(ModelBuilderResult result) {
        super(result.toString());
        this.result = result;
    }

    /**
     * Gets the interim result of the model building up to the point where it failed.
     *
     * @return The interim model building result or {@code null} if not available.
     */
    public ModelBuilderResult getResult() {
        return result;
    }

    /**
     * Gets the identifier of the POM whose effective model could not be built. The general format of the identifier is
     * {@code <groupId>:<artifactId>:<version>} but some of these coordinates may still be unknown at the point the
     * exception is thrown so this information is merely meant to assist the user.
     *
     * @return The identifier of the POM or an empty string if not known, never {@code null}.
     */
    public String getModelId() {<FILL_FUNCTION_BODY>}

    /**
     * Gets the problems that caused this exception.
     *
     * @return The problems that caused this exception, never {@code null}.
     */
    public List<ModelProblem> getProblems() {
        if (result == null) {
            return Collections.emptyList();
        }
        return Collections.unmodifiableList(result.getProblems());
    }
}

        if (result == null || result.getModelIds().isEmpty()) {
            return "";
        }
        return result.getModelIds().get(0);
    
<methods>public void <init>() ,public void <init>(java.lang.String) ,public void <init>(java.lang.String, java.lang.Throwable) ,public void <init>(java.lang.Throwable) <variables>