public IAST removeFromEnd(int fromPosition) { if (fromPosition == 1) { return new AST0(arg0); } if (fromPosition == 2) { return new AST1(arg0, arg1); } if (fromPosition == 3) { return new AST2(arg0, arg1, arg2); } if (fromPosition == 4) { return this; } throw new IndexOutOfBoundsException("Index: " + Integer.valueOf(fromPosition) + ", Size: " + size()); }