diff --git a/src/test/java/MetaQuerySerializationTest.java b/src/test/java/MetaQuerySerializationTest.java
index bd40204..b32b8f6 100644
--- a/src/test/java/MetaQuerySerializationTest.java
+++ b/src/test/java/MetaQuerySerializationTest.java
@@ -1,10 +1,7 @@
 import com.fasterxml.jackson.core.JsonGenerationException;
 import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.databind.JsonMappingException;
-import de.ids_mannheim.korap.query.serialize.JsonGenerator;
-import de.ids_mannheim.korap.query.serialize.MetaCollectionSerializer;
-import de.ids_mannheim.korap.query.serialize.MetaQuerySerializer;
-import de.ids_mannheim.korap.query.serialize.Serializer;
+import de.ids_mannheim.korap.query.serialize.*;
 import org.joda.time.DateTime;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -81,7 +78,7 @@
         System.out.println();
     }
 
-    //@Test
+    @Test
     public void testGenerator() {
                    /*
          * just for testing...
@@ -146,17 +143,85 @@
     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);
+        query.put("corpusID", "A00");
+        List<Map> l = ser.serializeQueries(query, MetaQuerySerializer.TYPE.FILTER);
+        query.clear();
+        query.put("corpusID", "A01");
+        List<Map> u = ser.serializeQueries(query, MetaQuerySerializer.TYPE.EXTEND);
+        l.addAll(u);
+        String val = ser.stringify(l);
+        System.out.println("results " + val);
         System.out.println();
-        List<String> l = new ArrayList<>();
-        l.add(s);
-        collSerializer.serializeResource(l);
 
+
+        String meta = ser.queryToMeta(val);
+
+        System.out.println("meta query " + meta);
+//        List<String> list = new ArrayList<>();
+//        list.add(val);
+//        List s = collSerializer.serializeResource(list);
+        System.out.println("printable list ");
+        System.out.println();
+
+    }
+
+    @Test
+    public void testResources() throws IOException {
+        String meta = "[{\"@type\":\"korap:meta-filter\",\"@value\":{\"@type\":\"korap:term\",\"@field\":\"korap:field#corpusID\",\"@value\":\"WPD\"}}]";
+        List s = new ArrayList();
+        s.add(meta);
+        List fin = ser.serializeResources(s);
+
+        String string = ser.serializeToMeta(fin);
+        System.out.println("meta string " + string);
+
+    }
+
+    @Test
+    public void testA00() throws IOException {
+        Map<String, String> query = new LinkedHashMap<>();
+        Serializer ser = new Serializer();
+        query.put("corpusID", "A00");
+        List<Map> l = ser.serializeQueries(query, MetaQuerySerializer.TYPE.FILTER);
+        query.clear();
+        query.put("corpusID", "A01");
+        List<Map> u = ser.serializeQueries(query, MetaQuerySerializer.TYPE.EXTEND);
+        l.addAll(u);
+        String val = ser.stringify(l);
+        List s = new ArrayList();
+        s.add(val);
+
+        List fin = ser.serializeResources(s);
+        System.out.println("A00 meta: " + fin);
+
+    }
+
+
+    @Test
+    public void testnewMetaQuery() throws IOException {
+        Map<String, String> qu = new LinkedHashMap<>();
+        Serializer ser = new Serializer();
+        qu.put("corpusID", "A00");
+        List<Map> l = ser.serializeQueries(qu, MetaQuerySerializer.TYPE.FILTER);
+        qu.clear();
+        qu.put("corpusID", "A01");
+        List<Map> u = ser.serializeQueries(qu, MetaQuerySerializer.TYPE.EXTEND);
+        l.addAll(u);
+        String val = ser.stringify(l);
+        List s = new ArrayList();
+        s.add(val);
+
+        List fin = ser.serializeResources(s);
+
+
+        System.out.println("=======   METAQUERY TESTING BEGIN =======");
+
+        MetaQuery query = new MetaQuery();
+        query.addMetaFilter("textClass", "wissenschaft");
+        query.addResources(s);
+        System.out.println("query "+ query.toMeta());
+        System.out.println("string "+ query.stringify());
+        System.out.println("=======   METAQUERY TESTING END =======");
     }
 
 }
