title: Java ArrayList serialization issue
body: <p>It is first time when I am doing serialization/deseraialization and I have an issue what I cannot understand. 
  So I have an employee class:</p>
  
  <pre><code>public class Employee implements Serializable{
  
  private static final long serialVersionUID = -8987739485808870716L;
  public  String firstName; 
  public String lastName;
  public int phoneNumber;
  public ArrayList&lt;Skill&gt; empSkillAry = new ArrayList&lt;Skill&gt;(); //
  </code></pre>
  
  <p>Skill class:</p>
  
  <pre><code>   public class Skill implements Serializable {
  
  private static final long serialVersionUID = 4862257193587272698L;
  public int skillID;
  public String skillName;
  </code></pre>
  
  <p>Schedule class:</p>
  
  <pre><code>    public class Schedule implements Serializable {
  
  private static final long serialVersionUID = 781243452337862636L;
  String Name;
  int CsID;
  public ArrayList&lt;Skill&gt; skillRequiredAry = new ArrayList&lt;Skill&gt;();
  </code></pre>
  
  <p>To empSkillAry and skillRequiredAry are added skill object. If empSkillAry contains all skillRequiredAry objects, employee can be assigned to the shift. 
  Lets say, employee has skill 1 and schedule also has skill 1. before serialization when comparing both arrays I get a positive result, however after deserialization it is negative. 
  Is there something wrong whith my serialization and deserialization code? 
  Here it is:</p>
  
  <pre><code>private static   void deserializeAry(ArrayList arrayToDesirialize,  String filePath){
      try {
          FileInputStream fileIn = new FileInputStream(filePath);
          ObjectInputStream in = new ObjectInputStream(fileIn);
          arrayToDesirialize = (ArrayList) in.readObject();
          System.out.println(arrayToDesirialize);
  
      } catch (FileNotFoundException e) {
          e.printStackTrace();
      } catch (IOException e) {
          e.printStackTrace();
      } catch (ClassNotFoundException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
      }
  
  }
  
  private static void serializeAry(ArrayList arrayToSerialize, String filePath){
      try {
          FileOutputStream fileOut = new FileOutputStream(filePath);
          ObjectOutputStream out = new ObjectOutputStream(fileOut);
          System.out.println(arrayToSerialize.toString());
          out.writeObject(arrayToSerialize);
          fileOut.close();
          out.close();
  
  
      } catch (FileNotFoundException e) {
          e.printStackTrace();
      } catch (IOException e) {
          e.printStackTrace();
      }
      }
  </code></pre>