// Path: idea/src/test/java/io/t28/json2java/idea/IdeaProjectTest.java
// public class IdeaProjectTest {
//     private JavaCodeInsightTestFixture fixture;
// 
//     @Before
//     public void setUp() throws Exception {
//         final IdeaTestFixtureFactory ideaFixtureFactory = IdeaTestFixtureFactory.getFixtureFactory();
//         final JavaTestFixtureFactory javaFixtureFactory = JavaTestFixtureFactory.getFixtureFactory();
//         final TestFixtureBuilder<IdeaProjectTestFixture> fixtureBuilder = ideaFixtureFactory.createLightFixtureBuilder();
//         fixture = javaFixtureFactory.createCodeInsightFixture(fixtureBuilder.getFixture());
//         fixture.setUp();
//     }
// 
//     @After
//     public void tearDown() throws Exception {
//         fixture.tearDown();
//     }
// 
//     @Nonnull
//     @CheckReturnValue
//     protected Application getApplication() {
//         if (fixture == null) {
//             throw new AssertionError("getApplication() must call after setUp()");
//         }
//         return ApplicationManager.getApplication();
//     }
// 
//     @Nonnull
//     @CheckReturnValue
//     protected Project getProject() {
//         if (fixture == null) {
//             throw new AssertionError("getProject() must call after setUp()");
//         }
//         return fixture.getProject();
//     }
// }
// 
// Path: idea/src/main/java/io/t28/json2java/idea/util/PsiTypeConverter.java
// public class PsiTypeConverter implements Function<TypeName, PsiType> {
//     private final PsiManager psiManager;
// 
//     @Inject
//     public PsiTypeConverter(@Nonnull PsiManager psiManager) {
//         this.psiManager = psiManager;
//     }
// 
//     @Nonnull
//     @CheckReturnValue
//     @Override
//     public PsiType apply(@Nonnull TypeName typeName) {
//         return Stream.of(PrimitiveType.values())
//                 .filter(primitiveType -> primitiveType.isSameAs(typeName))
//                 .map(PrimitiveType::psiType)
//                 .findFirst()
//                 .orElseGet(() -> PsiType.getJavaLangObject(psiManager, GlobalSearchScope.EMPTY_SCOPE));
//     }
// 
//     @Nonnull
//     @CheckReturnValue
//     static TypeName box(@Nonnull TypeName typeName) {
//         try {
//             return typeName.box();
//         } catch (Exception e) {
//             return typeName;
//         }
//     }
// 
//     @Nonnull
//     @CheckReturnValue
//     static TypeName unbox(@Nonnull TypeName typeName) {
//         try {
//             return typeName.unbox();
//         } catch (Exception e) {
//             return typeName;
//         }
//     }
// 
//     @SuppressWarnings("unused")
//     enum PrimitiveType {
//         BOOLEAN(PsiType.BOOLEAN, TypeName.BOOLEAN),
//         BYTE(PsiType.BYTE, TypeName.BYTE),
//         CHAR(PsiType.CHAR, TypeName.CHAR),
//         DOUBLE(PsiType.DOUBLE, TypeName.DOUBLE),
//         FLOAT(PsiType.FLOAT, TypeName.FLOAT),
//         INT(PsiType.INT, TypeName.INT),
//         LONG(PsiType.LONG, TypeName.LONG),
//         SHORT(PsiType.SHORT, TypeName.SHORT),
//         VOID(PsiType.VOID, TypeName.VOID);
// 
//         private final PsiType psiType;
//         private final TypeName typeName;
// 
//         PrimitiveType(@Nonnull PsiType psiType, @Nonnull TypeName typeName) {
//             this.psiType = psiType;
//             this.typeName = typeName;
//         }
// 
//         @Nonnull
//         @CheckReturnValue
//         PsiType psiType() {
//             return psiType;
//         }
// 
//         @CheckReturnValue
//         boolean isSameAs(@Nonnull TypeName typeName) {
//             final TypeName boxTypeName = box(typeName);
//             final TypeName unboxTypeName = unbox(typeName);
//             return this.typeName.equals(boxTypeName) || this.typeName.equals(unboxTypeName);
//         }
//     }
// }


import com.intellij.openapi.application.Application;
import com.intellij.openapi.project.Project;
import com.intellij.psi.PsiManager;
import com.squareup.javapoet.TypeName;
import io.t28.json2java.idea.IdeaProjectTest;
import io.t28.json2java.idea.util.PsiTypeConverter;
import org.junit.Before;
import org.junit.Test;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
/*
 * Copyright (c) 2017 Tatsuya Maki
 *
 * 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 io.t28.json2java.idea.naming;



public class MethodNamePolicyTest extends IdeaProjectTest {
    private Application application;

    private MethodNamePolicy underTest;

    @Before
    @Override
    public void setUp() throws Exception {
        super.setUp();
        application = getApplication();

        final Project project = getProject();
        final PsiManager psiManager = PsiManager.getInstance(project);
// Path: idea/src/test/java/io/t28/json2java/idea/IdeaProjectTest.java
// public class IdeaProjectTest {
//     private JavaCodeInsightTestFixture fixture;
// 
//     @Before
//     public void setUp() throws Exception {
//         final IdeaTestFixtureFactory ideaFixtureFactory = IdeaTestFixtureFactory.getFixtureFactory();
//         final JavaTestFixtureFactory javaFixtureFactory = JavaTestFixtureFactory.getFixtureFactory();
//         final TestFixtureBuilder<IdeaProjectTestFixture> fixtureBuilder = ideaFixtureFactory.createLightFixtureBuilder();
//         fixture = javaFixtureFactory.createCodeInsightFixture(fixtureBuilder.getFixture());
//         fixture.setUp();
//     }
// 
//     @After
//     public void tearDown() throws Exception {
//         fixture.tearDown();
//     }
// 
//     @Nonnull
//     @CheckReturnValue
//     protected Application getApplication() {
//         if (fixture == null) {
//             throw new AssertionError("getApplication() must call after setUp()");
//         }
//         return ApplicationManager.getApplication();
//     }
// 
//     @Nonnull
//     @CheckReturnValue
//     protected Project getProject() {
//         if (fixture == null) {
//             throw new AssertionError("getProject() must call after setUp()");
//         }
//         return fixture.getProject();
//     }
// }
// 
// Path: idea/src/main/java/io/t28/json2java/idea/util/PsiTypeConverter.java
// public class PsiTypeConverter implements Function<TypeName, PsiType> {
//     private final PsiManager psiManager;
// 
//     @Inject
//     public PsiTypeConverter(@Nonnull PsiManager psiManager) {
//         this.psiManager = psiManager;
//     }
// 
//     @Nonnull
//     @CheckReturnValue
//     @Override
//     public PsiType apply(@Nonnull TypeName typeName) {
//         return Stream.of(PrimitiveType.values())
//                 .filter(primitiveType -> primitiveType.isSameAs(typeName))
//                 .map(PrimitiveType::psiType)
//                 .findFirst()
//                 .orElseGet(() -> PsiType.getJavaLangObject(psiManager, GlobalSearchScope.EMPTY_SCOPE));
//     }
// 
//     @Nonnull
//     @CheckReturnValue
//     static TypeName box(@Nonnull TypeName typeName) {
//         try {
//             return typeName.box();
//         } catch (Exception e) {
//             return typeName;
//         }
//     }
// 
//     @Nonnull
//     @CheckReturnValue
//     static TypeName unbox(@Nonnull TypeName typeName) {
//         try {
//             return typeName.unbox();
//         } catch (Exception e) {
//             return typeName;
//         }
//     }
// 
//     @SuppressWarnings("unused")
//     enum PrimitiveType {
//         BOOLEAN(PsiType.BOOLEAN, TypeName.BOOLEAN),
//         BYTE(PsiType.BYTE, TypeName.BYTE),
//         CHAR(PsiType.CHAR, TypeName.CHAR),
//         DOUBLE(PsiType.DOUBLE, TypeName.DOUBLE),
//         FLOAT(PsiType.FLOAT, TypeName.FLOAT),
//         INT(PsiType.INT, TypeName.INT),
//         LONG(PsiType.LONG, TypeName.LONG),
//         SHORT(PsiType.SHORT, TypeName.SHORT),
//         VOID(PsiType.VOID, TypeName.VOID);
// 
//         private final PsiType psiType;
//         private final TypeName typeName;
// 
//         PrimitiveType(@Nonnull PsiType psiType, @Nonnull TypeName typeName) {
//             this.psiType = psiType;
//             this.typeName = typeName;
//         }
// 
//         @Nonnull
//         @CheckReturnValue
//         PsiType psiType() {
//             return psiType;
//         }
// 
//         @CheckReturnValue
//         boolean isSameAs(@Nonnull TypeName typeName) {
//             final TypeName boxTypeName = box(typeName);
//             final TypeName unboxTypeName = unbox(typeName);
//             return this.typeName.equals(boxTypeName) || this.typeName.equals(unboxTypeName);
//         }
//     }
// }


// Path: idea/src/test/java/io/t28/json2java/idea/naming/MethodNamePolicyTest.java
import com.intellij.openapi.application.Application;
import com.intellij.openapi.project.Project;
import com.intellij.psi.PsiManager;
import com.squareup.javapoet.TypeName;
import io.t28.json2java.idea.IdeaProjectTest;
import io.t28.json2java.idea.util.PsiTypeConverter;
import org.junit.Before;
import org.junit.Test;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;

/*
 * Copyright (c) 2017 Tatsuya Maki
 *
 * 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 io.t28.json2java.idea.naming;



public class MethodNamePolicyTest extends IdeaProjectTest {
    private Application application;

    private MethodNamePolicy underTest;

    @Before
    @Override
    public void setUp() throws Exception {
        super.setUp();
        application = getApplication();

        final Project project = getProject();
        final PsiManager psiManager = PsiManager.getInstance(project);
        final PsiTypeConverter converter = new PsiTypeConverter(psiManager);