### Question:
ImmutableNodeInst extends ImmutableElectricObject { public ImmutableNodeInst withoutVariable(Variable.Key key) { Variable[] vars = arrayWithoutVariable(key); if (this.getVars() == vars) { return this; } int flags = updateHardShape(this.flags, vars); return newInstance(this.nodeId, this.protoId, this.name, this.nameDescriptor, this.orient, this.anchor, this.size, flags, this.techBits, this.protoDescriptor, vars, this.ports, getDefinedParams()); } ImmutableNodeInst(int nodeId, NodeProtoId protoId, Name name, TextDescriptor nameDescriptor,
            Orientation orient, EPoint anchor, EPoint size,
            int flags, byte techBits, TextDescriptor protoDescriptor, Variable[] vars, ImmutablePortInst[] ports); static ImmutableNodeInst newInstance(int nodeId, NodeProtoId protoId, Name name, TextDescriptor nameDescriptor,
            Orientation orient, EPoint anchor, EPoint size,
            int flags, int techBits, TextDescriptor protoDescriptor); ImmutableNodeInst withName(Name name); ImmutableNodeInst withNameDescriptor(TextDescriptor nameDescriptor); ImmutableNodeInst withOrient(Orientation orient); ImmutableNodeInst withAnchor(EPoint anchor); ImmutableNodeInst withSize(EPoint size); ImmutableNodeInst withStateBits(ImmutableNodeInst d); ImmutableNodeInst withFlag(Flag flag, boolean value); ImmutableNodeInst withTechSpecific(int techBits); ImmutableNodeInst withProtoDescriptor(TextDescriptor protoDescriptor); ImmutableNodeInst withVariable(Variable var); ImmutableNodeInst withoutVariable(Variable.Key key); boolean isEasyShape(); ImmutableNodeInst withPortInst(PortProtoId portProtoId, ImmutablePortInst portInst); boolean isUsernamed(); boolean isCellInstance(); ImmutablePortInst getPortInst(PortProtoId portProtoId); Iterator<PortProtoId> getPortsWithVariables(); boolean hasPortInstVariables(); boolean is(Flag flag); int hashCodeExceptVariables(); boolean equalsExceptVariables(ImmutableElectricObject o); void check(); static boolean isCellCenter(NodeProtoId protoId); int getElibBits(); static int flagsFromElib(int elibBits); static int techSpecificFromElib(int elibBits); void computeBounds(BoundsBuilder b, Rectangle2D.Double dstBounds); EPoint[] getTrace(); ImmutableNodeInst withTrace(Point2D[] points, TextDescriptor td); double[] getArcDegrees(); double getSerpentineTransistorLength(); static final Flag HARD_SELECT; static final Flag VIS_INSIDE; static final Flag LOCKED; final static ImmutableNodeInst[] NULL_ARRAY; final static ImmutableArrayList<ImmutableNodeInst> EMPTY_LIST; final int nodeId; final NodeProtoId protoId; final Name name; final TextDescriptor nameDescriptor; final Orientation orient; final EPoint anchor; final EPoint size; final byte techBits; final TextDescriptor protoDescriptor; static Comparator<ImmutableNodeInst> NAME_ORDER; }### Answer:
@Test public void testWithoutVariable() { System.out.println("withoutVariable"); Variable.Key varKey = Variable.newKey("key"); Variable var = Variable.newInstance(varKey, "valueA", TextDescriptor.newTextDescriptor(new MutableTextDescriptor())); ImmutableNodeInst n1 = n0.withVariable(var); assertSame(n1, n1.withoutVariable(Variable.newKey("key2"))); ImmutableNodeInst n2 = n1.withoutVariable(varKey); assertEquals(0, n2.getNumVariables()); }