if (!(value instanceof Serializable))
if (value != null && !(value instanceof Serializable))
   public static void writeList(ObjectOutput out, List list) throws IOException   {      out.writeInt(list.size());      Iterator iter = list.iterator();      while (iter.hasNext())      {         Object value = iter.next();         if (!(value instanceof Serializable))         {            throw new IOException("Object in List must be serializable: " + value);         }         internalWriteObject(out, (Serializable)value, false);      }   }