package metisto.digisim;

public final class Components {

    public static Connection fixed(final boolean value) {
        return new Connection() {
            public boolean value() {
                return value;
            }
        };
    }

    public static Wire connection(final Connection connection) {
        final Wire wire = new Wire();
        wire.connection(connection);
        return wire;
    }

    static And and(final Connection a, final Connection b) {
        final And and = new And();
        and.a(a);
        and.b(b);
        return and;
    }

    static Or or(final Connection a, final Connection b) {
        final Or or = new Or();
        or.a(a);
        or.b(b);
        return or;
    }

    static Xor xor(final Connection a, final Connection b) {
        final Xor xor = new Xor();
        xor.a(a);
        xor.b(b);
        return xor;
    }

    static HalfAdder halfAdder(final Connection a, final Connection b) {
        final HalfAdder halfAdder = new HalfAdder();
        halfAdder.a(a);
        halfAdder.b(b);
        return halfAdder;
    }
}

@@ -129,117 +129,19 @@
 urn 
-new Connection() %7B%0A            public boolean value() %7B%0A                return value;%0A            %7D%0A        %7D
+() -%3E value
 ;%0A  

Simplify with lambda