instances.add(iter.next());
instances.add(new SimpleReference(iter.next()));
    private synchronized void writeObject(final ObjectOutputStream out) throws IOException {        out.defaultWriteObject();        final List instances = new ArrayList(availableInstances);        for (final Iterator iter = busyInstances.keySet().iterator(); iter.hasNext();) {            instances.add(iter.next());        }        int mode = serializationMode;        if (mode == SERIALIZATION_FORCE) {            try {                final ByteArrayOutputStream buffer = new ByteArrayOutputStream();                final ObjectOutputStream testStream = new ObjectOutputStream(buffer);                testStream.writeObject(instances); // force NotSerializableException                testStream.close();                mode = SERIALIZATION_STANDARD;            } catch (final NotSerializableException e) {                mode = SERIALIZATION_NONE;            }        }        if (mode == SERIALIZATION_STANDARD) {            out.writeObject(instances);        } else {            out.writeObject(new ArrayList());        }    }