diff --git a/src/test/java/MetaQuerySerializationTest.java b/src/test/java/MetaQuerySerializationTest.java
index b1062d8..bd40204 100644
--- a/src/test/java/MetaQuerySerializationTest.java
+++ b/src/test/java/MetaQuerySerializationTest.java
@@ -11,10 +11,7 @@
 import org.junit.runners.JUnit4;
 
 import java.io.IOException;
-import java.util.HashMap;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 /**
  * @author hanl
@@ -50,12 +47,7 @@
         j.put("textClass", "wissenschaft");
         String s = querySerializer.stringify(j, MetaQuerySerializer.TYPE.FILTER);
         System.out.println("------ TEXT SINGLE " + s);
-    }
-
-    @Test
-    public void testResourceMeta() throws IOException {
-        String s = collSerializer.serialize("25");
-        System.out.println(" --- RESULT JSON " + s);
+        System.out.println();
     }
 
     @Test
@@ -66,6 +58,7 @@
         queries.put("author", "Goethe");
         String f = querySerializer.stringify(queries, MetaQuerySerializer.TYPE.FILTER);
         System.out.println("value until/since : " + f);
+        System.out.println();
     }
 
     @Test
@@ -75,6 +68,7 @@
         queries.put("author", "Hesse");
         String f = querySerializer.stringify(queries, MetaQuerySerializer.TYPE.FILTER);
         System.out.println("value until : " + f);
+        System.out.println();
     }
 
     @Test
@@ -84,6 +78,7 @@
         queries.put("author", "Kafka");
         String f = querySerializer.stringify(queries, MetaQuerySerializer.TYPE.FILTER);
         System.out.println("value since : " + f);
+        System.out.println();
     }
 
     //@Test
@@ -109,6 +104,7 @@
             } catch (NullPointerException npe) {
                 npe.printStackTrace();
                 System.out.println("null\n");
+                System.out.println();
             } catch (JsonGenerationException e) {
                 e.printStackTrace();
             } catch (JsonMappingException e) {
@@ -132,6 +128,8 @@
         List f = querySerializer.serializeQueries(queries, MetaQuerySerializer.TYPE.EXTEND);
         s.addAll(f);
         System.out.println("--- ALL " + s);
+        System.out.println();
+
     }
 
     @Test
@@ -140,7 +138,25 @@
         queries.put("pubDate", "<" + String.valueOf(new DateTime().getMillis()));
         queries.put("author", "Kafka");
         List s = querySerializer.serializeQueries(queries, MetaQuerySerializer.TYPE.FILTER);
-        System.out.println("array repres " + ser.serializeMeta(s));
+        System.out.println("array repres " + ser.serializeToMeta(s));
+        System.out.println();
+    }
+
+    @Test
+    public void testCollections() throws IOException {
+        Map<String, String> query = new LinkedHashMap<>();
+        Serializer ser = new Serializer();
+        query.put("corpusID", "WPD");
+
+        List<Map> p = ser.serializeQueries(query, MetaQuerySerializer.TYPE.FILTER);
+        String s = ser.stringify(p);
+
+        System.out.println("results " + s);
+        System.out.println();
+        List<String> l = new ArrayList<>();
+        l.add(s);
+        collSerializer.serializeResource(l);
+
     }
 
 }
