This method gets fields of specified type from a given class. @param clazz the class you want to check @param type the type of field you want @return a list of fields matching the given type
(Class<?> clazz, Class<?> type)
| 143 | * @return a list of fields matching the given type |
| 144 | */ |
| 145 | private static List<Field> getFields(Class<?> clazz, Class<?> type) { |
| 146 | Field[] fields = clazz.getDeclaredFields(); |
| 147 | List<Field> namedFields = new ArrayList<>(); |
| 148 | for (Field f : fields) { |
| 149 | f.setAccessible(true); |
| 150 | if (f.getType().equals(type)) { |
| 151 | namedFields.add(f); |
| 152 | } |
| 153 | } |
| 154 | return namedFields; |
| 155 | } |
| 156 | |
| 157 | /** |
| 158 | * This method checks whether iterating through a list forwards and backwards |
no test coverage detected