// Path: src/main/java/org/laughingpanda/beaninject/impl/Accessor.java
// public class Accessor {
// 
//     public static List<Method> methods(Class<?> clazz) {
//         Method[] declared = clazz.getDeclaredMethods();
//         List<Method> methods = new ArrayList<Method>(Arrays
//                 .asList(declared));
//         if (clazz.getSuperclass() != null) {
//             methods.addAll(methods(clazz.getSuperclass()));
//         }
//         return methods;
//     }
// 
//     public static List<Field> fields(Class<?> clazz) {
//         Field[] declared = clazz.getDeclaredFields();
//         List<Field> fields = new ArrayList<Field>(Arrays
//                 .asList(declared));
//         if (clazz.getSuperclass() != null) {
//             fields.addAll(fields(clazz.getSuperclass()));
//         }
//         return fields;
//     }
// 
//     public static Field field(String name, Class<?> clazz) {
//         for (Field field : fields(clazz)) {
//             if (field.getName().equals(name)) {
//                 return makeAccessible(field);
//             }
//         }
//         return null;
//     }
// 
//     private static Field makeAccessible(Field field) {
//         if (!field.isAccessible()) {
//             field.setAccessible(true);
//         }
//         return field;
//     }
// 
//     public static List<Field> fieldsAssignableFrom(Class<?> type,
//             Class<?> target) {
//         List<Field> fields = new ArrayList<Field>();
//         for (Field field : fields(target)) {
//             if (field.getType().isAssignableFrom(type)) {
//                 fields.add(field);
//             }
//         }
//         return fields;
//     }
// 
//     public static List<Field> fieldsOfType(Class<?> type, Class<?> target) {
//         List<Field> fields = new ArrayList<Field>();
//         for (Field field : fields(target)) {
//             if (field.getType().equals(type)) {
//                 fields.add(field);
//             }
//         }
//         return fields;
//     }
//     
//     public static Field annotatedField(
//             Class<? extends Annotation> annotation,
//             Class<? extends Object> clazz) {
//         for (Field field : fields(clazz)) {
//             if (field.isAnnotationPresent(annotation)) {
//                 return field;
//             }
//         }
//         return null;
//     }
// 
// }
// 
// Path: src/test/java/org/laughingpanda/beaninject/target/TypeClassA.java
// public class TypeClassA extends TypeClass {
// }
// 
// Path: src/test/java/org/laughingpanda/beaninject/target/TypeClassB.java
// public class TypeClassB extends TypeClass {
// }


import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.fail;
import junit.framework.JUnit4TestAdapter;
import org.junit.Test;
import org.laughingpanda.beaninject.impl.Accessor;
import org.laughingpanda.beaninject.target.TypeClassA;
import org.laughingpanda.beaninject.target.TypeClassB;

/*
 * Copyright 2006 Lasse Koskela
 *
 * 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.laughingpanda.beaninject;



/**
 * @author Lasse Koskela
 */
public class TestTypeInjectionWithMultipleValues {

	private Object target = new Object() {
		@SuppressWarnings("unused")

// Path: src/main/java/org/laughingpanda/beaninject/impl/Accessor.java
// public class Accessor {
// 
//     public static List<Method> methods(Class<?> clazz) {
//         Method[] declared = clazz.getDeclaredMethods();
//         List<Method> methods = new ArrayList<Method>(Arrays
//                 .asList(declared));
//         if (clazz.getSuperclass() != null) {
//             methods.addAll(methods(clazz.getSuperclass()));
//         }
//         return methods;
//     }
// 
//     public static List<Field> fields(Class<?> clazz) {
//         Field[] declared = clazz.getDeclaredFields();
//         List<Field> fields = new ArrayList<Field>(Arrays
//                 .asList(declared));
//         if (clazz.getSuperclass() != null) {
//             fields.addAll(fields(clazz.getSuperclass()));
//         }
//         return fields;
//     }
// 
//     public static Field field(String name, Class<?> clazz) {
//         for (Field field : fields(clazz)) {
//             if (field.getName().equals(name)) {
//                 return makeAccessible(field);
//             }
//         }
//         return null;
//     }
// 
//     private static Field makeAccessible(Field field) {
//         if (!field.isAccessible()) {
//             field.setAccessible(true);
//         }
//         return field;
//     }
// 
//     public static List<Field> fieldsAssignableFrom(Class<?> type,
//             Class<?> target) {
//         List<Field> fields = new ArrayList<Field>();
//         for (Field field : fields(target)) {
//             if (field.getType().isAssignableFrom(type)) {
//                 fields.add(field);
//             }
//         }
//         return fields;
//     }
// 
//     public static List<Field> fieldsOfType(Class<?> type, Class<?> target) {
//         List<Field> fields = new ArrayList<Field>();
//         for (Field field : fields(target)) {
//             if (field.getType().equals(type)) {
//                 fields.add(field);
//             }
//         }
//         return fields;
//     }
//     
//     public static Field annotatedField(
//             Class<? extends Annotation> annotation,
//             Class<? extends Object> clazz) {
//         for (Field field : fields(clazz)) {
//             if (field.isAnnotationPresent(annotation)) {
//                 return field;
//             }
//         }
//         return null;
//     }
// 
// }
// 
// Path: src/test/java/org/laughingpanda/beaninject/target/TypeClassA.java
// public class TypeClassA extends TypeClass {
// }
// 
// Path: src/test/java/org/laughingpanda/beaninject/target/TypeClassB.java
// public class TypeClassB extends TypeClass {
// }


// Path: src/test/java/org/laughingpanda/beaninject/TestTypeInjectionWithMultipleValues.java
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.fail;
import junit.framework.JUnit4TestAdapter;
import org.junit.Test;
import org.laughingpanda.beaninject.impl.Accessor;
import org.laughingpanda.beaninject.target.TypeClassA;
import org.laughingpanda.beaninject.target.TypeClassB;

/*
 * Copyright 2006 Lasse Koskela
 *
 * 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.laughingpanda.beaninject;



/**
 * @author Lasse Koskela
 */
public class TestTypeInjectionWithMultipleValues {

	private Object target = new Object() {
		@SuppressWarnings("unused")

		public TypeClassA fieldA;
