class InputSource implements Serializable {

    private final String modelId;
    private final String location;
    private final List<InputSource> inputs;

    public InputSource(String modelId, String location) {
        this.modelId = modelId;
        this.location = location;
        this.inputs = null;
    }

    public InputSource(Collection<InputSource> inputs) {
        this.modelId = null;
        this.location = null;
        this.inputs = ImmutableCollections.copy(inputs);
    }

    /**
     * Get the path/URL of the POM or {@code null} if unknown.
     *
     * @return the location
     */
    public String getLocation() {
        return this.location;
    }

    /**
     * Get the identifier of the POM in the format {@code <groupId>:<artifactId>:<version>}.
     *
     * @return the model id
     */
    public String getModelId() {
        return this.modelId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        InputSource that = (InputSource) o;
        return Objects.equals(modelId, that.modelId)
                && Objects.equals(location, that.location)
                && Objects.equals(inputs, that.inputs);
    }

    @Override
    public int hashCode() {
        return Objects.hash(modelId, location, inputs);
    }

    Stream<InputSource> sources() {
        return inputs != null ? inputs.stream() : Stream.of(this);
    }

    @Override
    public String toString() {<FILL_FUNCTION_BODY>}

    public static InputSource merge(InputSource src1, InputSource src2) {
        return new InputSource(Stream.concat(src1.sources(), src2.sources()).collect(Collectors.toSet()));
    }
}

        if (inputs != null) {
            return inputs.stream().map(InputSource::toString).collect(Collectors.joining(", ", "merged[", "]"));
        }
        return getModelId() + " " + getLocation();
    
<no_super_class>