/*
 * This file is part of FastClasspathScanner.
 * 
 * Author: Luke Hutchison
 * 
 * Hosted at: https://github.com/lukehutch/fast-classpath-scanner
 * 
 * --
 *
 * The MIT License (MIT)
 *
 * Copyright (c) 2016 Luke Hutchison
 * 
 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
 * documentation files (the "Software"), to deal in the Software without restriction, including without
 * limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
 * the Software, and to permit persons to whom the Software is furnished to do so, subject to the following
 * conditions:
 * 
 * The above copyright notice and this permission notice shall be included in all copies or substantial
 * portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
 * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
 * EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
 * OR OTHER DEALINGS IN THE SOFTWARE.
 */
package io.github.lukehutch.fastclasspathscanner.issues.issue152;

import static org.assertj.core.api.StrictAssertions.assertThat;

import java.io.IOException;
import java.util.List;
import java.util.Map;
import java.util.Set;

import org.junit.Test;

import io.github.lukehutch.fastclasspathscanner.FastClasspathScanner;
import io.github.lukehutch.fastclasspathscanner.scanner.ClassInfo;
import io.github.lukehutch.fastclasspathscanner.scanner.FieldInfo;
import io.github.lukehutch.fastclasspathscanner.scanner.MethodInfo;

public class Issue152Test {
    public Map<Integer, Map<String, Boolean>> testField;

    public Set<Integer> testMethod(final List<String[]> param0, final Map<String, Map<Integer, Boolean>> param2,
            final double[][][] param3, final int param4, final TestType[] param5,
            final Set<? extends TestType> param6, final List<? super TestType> param7, final Map<Integer, ?> param8,
            final Set<String>[] param9) {
        return null;
    }

    public static class TestType {
    }

    @Test
    public void issue152Test() throws IOException {
        // Scans io.github.lukehutch.fastclasspathscanner.issues.issue146.CompiledWithJDK8,
        // which is in src/test/resources
        final String pkg = Issue152Test.class.getPackage().getName();
        final ClassInfo classInfo = new FastClasspathScanner(pkg) //
                .enableMethodInfo() //
                .enableFieldInfo() //
                .scan() //
                .getClassNameToClassInfo() //
                .get(Issue152Test.class.getName());
        final MethodInfo methodInfo = classInfo //
                .getMethodInfo("testMethod") //
                .get(0);
        final String cmp = "public Set<Integer> testMethod("
                + "List<String[]>, Map<String, Map<Integer, Boolean>>, double[][][], int, "
                + TestType.class.getName() + "[], Set<? extends " + TestType.class.getName() + ">, List<? super "
                + TestType.class.getName() + ">, Map<Integer, ?>, Set<String>[])";
        System.out.println(methodInfo);
        System.out.println(cmp);
        assertThat(methodInfo.toString()) //
                .isEqualTo(cmp);
        final FieldInfo fieldInfo = classInfo //
                .getFieldInfo("testField");
        assertThat(fieldInfo.toString()) //
                .isEqualTo("public Map<Integer, Map<String, Boolean>> testField");
    }
}

@@ -1685,143 +1685,8 @@
 nfo;
-%0Aimport io.github.lukehutch.fastclasspathscanner.scanner.FieldInfo;%0Aimport io.github.lukehutch.fastclasspathscanner.scanner.MethodInfo;
 %0A%0Apu
@@ -2259,142 +2259,8 @@
 n %7B%0A
-        // Scans io.github.lukehutch.fastclasspathscanner.issues.issue146.CompiledWithJDK8,%0A        // which is in src/test/resources%0A
     
@@ -2608,38 +2608,19 @@
     
-final MethodInfo methodInfo = 
+assertThat(
 clas
@@ -2703,37 +2703,59 @@
 t(0)
-;%0A        final String cmp = 
+.toString()) //%0A                        .isEqualTo(
 %22pub
@@ -2784,16 +2784,32 @@
 ethod(%22%0A
+                
         
@@ -2892,16 +2892,32 @@
  int, %22%0A
+                
         
@@ -2996,24 +2996,56 @@
 ss.getName()
+%0A                               
  + %22%3E, List%3C
@@ -3053,32 +3053,16 @@
  super %22
-%0A               
  + TestT
@@ -3076,24 +3076,56 @@
 ss.getName()
+%0A                               
  + %22%3E, Map%3CI
@@ -3155,197 +3155,30 @@
 %5B%5D)%22
-;%0A        System.out.println(methodInfo);%0A        System.out.println(cmp);%0A        assertThat(methodInfo.toString()) //%0A                .isEqualTo(cmp);%0A        final FieldInfo fieldInfo = 
+);%0A        assertThat(
 clas
@@ -3232,38 +3232,8 @@
 ld%22)
-;%0A        assertThat(fieldInfo
 .toS
@@ -3236,32 +3236,40 @@
 .toString()) //%0A
+        
                 

Clean up test