Comments on my Java pattern for Mutable turned Immutable objects Commenting omitted to give you the idea.  I've been toying with this recently as a variant of the Builder pattern.  I've recently fallen in love with immutable objects for the benefits they give in larger concurrent systems.

Questions: 

Is there a way to do this without having to instantiate two Objects? (ie. Something.Mutable extends Something but adds setters, while preserving final on the underlying fields once the object gets finalized?

If I have to instantiate two Objects, can I keep final on their somehow and not repeat myself in the contained Builder Object?

public class Something {
    private final int someInteger;
    private final String someString;
    public Something(int someInteger, String someString) {
        this.someInteger = someInteger;
        this.someString = someString;
    }
    public int getSomeInteger() { return someInteger; }
    public String getSomeString() { return someString; }

    public static class Mutable {
        private int someInteger;
        private String someString;
        public Something.Mutable() {}
        public int getSomeInteger() { return someInteger; }
        public String getSomeString() { return someString; }

        public Something.Mutable setSomeInteger(int someInteger) { 
            this.someInteger = someInteger;
            return this;
        }
        public Something.Mutable setSomeString(String someString) { 
            this.someString = someString;
            return this;
        }

        public Something build() {
            return new Something(someInteger, someString);
        }
    }
}


Here is an example of me using it:

Something something = new Something.Mutable()
        .setString("hi")
        .setInteger(42)
        .build();
If you really want to avoid object creation, you have no other choice as dropping final, e.g.:

public interface Something {

    public int getSomeInteger();
    public String getSomeString();

    public static class Mutable implements Something {
        private int someInteger;
        private String someString;
        private boolean open = true;

        public int getSomeInteger() {
            return someInteger;
        }

        public String getSomeString() {
            return someString;
        }

        public Something.Mutable setSomeInteger(int someInteger) {
            assert open;
            this.someInteger = someInteger;
            return this;
        }

        public Something.Mutable setSomeString(String someString) {
            assert open;
            this.someString = someString;
            return this;
        }

        public Something make() {
            open = false;
            return this;
        }
    }
}


But this pattern is brittle, and the Java runtime is pretty good in dealing with object creation these days, so if you don't write a graphic or math lib or so, you shouldn't care about.