/*
 * Copyright 2011 Goldman Sachs.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.gs.collections.impl.list.mutable;

import com.gs.collections.impl.test.Verify;
import org.junit.Test;

public class ArrayListAdapterSerializationTest
{
    @Test
    public void serializedForm()
    {
        String javaVersion = System.getProperty("java.version");
        if (javaVersion.startsWith("1.8.") || "1.7.0_45".equals(javaVersion))
        {
            Verify.assertSerializedForm(
                    1L,
                    "rO0ABXNyADVjb20uZ3MuY29sbGVjdGlvbnMuaW1wbC5saXN0Lm11dGFibGUuQXJyYXlMaXN0QWRh\n"
                            + "cHRlcgAAAAAAAAABAgABTAAIZGVsZWdhdGV0ABVMamF2YS91dGlsL0FycmF5TGlzdDt4cHNyABNq\n"
                            + "YXZhLnV0aWwuQXJyYXlMaXN0eIHSHZnHYZ0DAAFJAARzaXpleHAAAAAAdwQAAAAAeA==",
                    ArrayListAdapter.newList());
        }
        else
        {
            Verify.assertSerializedForm(
                    1L,
                    "rO0ABXNyADVjb20uZ3MuY29sbGVjdGlvbnMuaW1wbC5saXN0Lm11dGFibGUuQXJyYXlMaXN0QWRh\n"
                            + "cHRlcgAAAAAAAAABAgABTAAIZGVsZWdhdGV0ABVMamF2YS91dGlsL0FycmF5TGlzdDt4cHNyABNq\n"
                            + "YXZhLnV0aWwuQXJyYXlMaXN0eIHSHZnHYZ0DAAFJAARzaXpleHAAAAAAdwQAAAAKeA==",
                    ArrayListAdapter.newList());
        }
    }
}

@@ -12,17 +12,17 @@
 ight 201
-1
+4
  Goldman
@@ -809,165 +809,8 @@
   %7B%0A
-        String javaVersion = System.getProperty(%22java.version%22);%0A        if (javaVersion.startsWith(%221.8.%22) %7C%7C %221.7.0_45%22.equals(javaVersion))%0A        %7B%0A    
     
@@ -850,36 +850,32 @@
                 
-    
 1L,%0A            
@@ -870,36 +870,32 @@
                 
- 
-   
 %22rO0ABXNyADVjb20
@@ -951,36 +951,32 @@
 YXlMaXN0QWRh%5Cn%22%0A
-    
                 
@@ -1058,36 +1058,32 @@
 dDt4cHNyABNq%5Cn%22%0A
-    
                 
@@ -1172,36 +1172,32 @@
                 
-    
 ArrayListAdapter
@@ -1209,482 +1209,12 @@
 ist(
+0
 ));
-%0A        %7D%0A        else%0A        %7B%0A            Verify.assertSerializedForm(%0A                    1L,%0A                    %22rO0ABXNyADVjb20uZ3MuY29sbGVjdGlvbnMuaW1wbC5saXN0Lm11dGFibGUuQXJyYXlMaXN0QWRh%5Cn%22%0A                            + %22cHRlcgAAAAAAAAABAgABTAAIZGVsZWdhdGV0ABVMamF2YS91dGlsL0FycmF5TGlzdDt4cHNyABNq%5Cn%22%0A                            + %22YXZhLnV0aWwuQXJyYXlMaXN0eIHSHZnHYZ0DAAFJAARzaXpleHAAAAAAdwQAAAAKeA==%22,%0A                    ArrayListAdapter.newList());%0A        %7D
 %0A   

Make ArrayListAdapterSerializationTest more robust for future versions of Java. Fixes #12.