/*
 * JBoss, Home of Professional Open Source.
 * Copyright 2014 Red Hat, Inc., and individual contributors
 * as indicated by the @author tags.
 *
 * 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 org.jboss.test.marshalling;

import java.util.concurrent.PriorityBlockingQueue;
import org.jboss.marshalling.cloner.ClonerConfiguration;
import org.jboss.marshalling.MarshallingConfiguration;
import org.jboss.marshalling.cloner.ObjectCloner;
import org.jboss.marshalling.cloner.ObjectClonerFactory;
import org.jboss.marshalling.cloner.ObjectCloners;
import org.testng.annotations.Test;


/**
 * OtherMarshallerTests
 */
public final class OtherMarshallerTests extends TestBase {

    public OtherMarshallerTests(TestMarshallerProvider testMarshallerProvider, TestUnmarshallerProvider testUnmarshallerProvider, MarshallingConfiguration configuration) {
        super(testMarshallerProvider, testUnmarshallerProvider, configuration);
    }    

    @Test
    public void testPriorityBlockingQueue() throws Throwable {
        final ObjectClonerFactory clonerFactory = ObjectCloners.getSerializingObjectClonerFactory();
        final ClonerConfiguration configuration = new ClonerConfiguration();
        final ObjectCloner cloner = clonerFactory.createCloner(configuration);
        PriorityBlockingQueueTestObject testObject = new PriorityBlockingQueueTestObject<Integer>();
        testObject.add(new Integer(100));
        cloner.clone(testObject);
    }

    public static class PriorityBlockingQueueTestObject<T> {
        private PriorityBlockingQueue<T> queue;
        public void add(T item) {
            this.queue.add(item);
        }
    }

}

@@ -738,16 +738,45 @@
 lling;%0A%0A
+import java.io.Serializable;%0A
 import j
@@ -1498,24 +1498,37 @@
 %0A    public 
+synchronized 
 void testPri
@@ -1921,24 +1921,61 @@
 Integer%3E();%0A
+        if(testObject != null) %7B%0A    
         test
@@ -2004,16 +2004,20 @@
 (100));%0A
+    
         
@@ -2042,16 +2042,26 @@
 bject);%0A
+        %7D%0A
     %7D%0A%0A 
@@ -2117,16 +2117,40 @@
 bject%3CT%3E
+ implements Serializable
  %7B%0A     
@@ -2190,16 +2190,49 @@
 T%3E queue
+ = new PriorityBlockingQueue%3CT%3E()
 ;%0A      
@@ -2309,11 +2309,10 @@
 %7D%0A    %7D%0A
-%0A
 %7D%0A

fix test case