### Question:
ReflectionUtils { public static Field findField(Class<?> typeOfClass, Class<?> typeOfField) { if (CACHE.containsKey(typeOfClass)) { Map<Class<?>, Field> fields = CACHE.get(typeOfClass); if (fields.containsKey(typeOfField)) { return fields.get(typeOfField); } } Field[] fields = typeOfClass.getDeclaredFields(); for (Field f : fields) { if (f.getType().equals(typeOfField)) { try { f.setAccessible(true); if (!CACHE.containsKey(typeOfClass)) { CACHE.put(typeOfClass, Maps.<Class<?>, Field>newHashMap()); } CACHE.get(typeOfClass).put(typeOfField, f); return f; } catch (Exception e) { throw new RuntimeException( "WorldDownloader: Couldn't get private Field of type \"" + typeOfField + "\" from class \"" + typeOfClass + "\" !", e); } } } throw new RuntimeException( "WorldDownloader: Couldn't find any Field of type \"" + typeOfField + "\" from class \"" + typeOfClass + "\" !"); }  static Field findField(Class<?> typeOfClass, Class<?> typeOfField); static T findAndGetPrivateField(Object object, Class<T> typeOfField); static void findAndSetPrivateField(Object object, Class<T> typeOfField,
			T value); static T findAndGetPrivateField(K object, Class<K> typeOfObject,
			Class<T> typeOfField); static void findAndSetPrivateField(K object, Class<K> typeOfObject,
			Class<T> typeOfField, T value); static boolean isCreativeContainer(Class<? extends Container> containerClass); @Deprecated static Field stealField(Class<?> typeOfClass, Class<?> typeOfField); @Deprecated static T stealAndGetField(Object object, Class<T> typeOfField); @SuppressWarnings("unchecked") @Deprecated static void stealAndSetField(Object object, Class<T> typeOfField,
			Object value); @SuppressWarnings("unchecked") @Deprecated static T stealAndGetField(Object object, Class<?> typeOfObject,
			Class<T> typeOfField); @SuppressWarnings("unchecked") @Deprecated static void stealAndSetField(Object object, Class<?> typeOfObject,
			Class<?> typeOfField, Object value);  }### Answer:
@Test public void testPrimitives() { @SuppressWarnings("unused") class Test { private int primitive; private Integer boxed; } assertThat(ReflectionUtils.findField(Test.class, int.class).getName(), is("primitive")); assertThat(ReflectionUtils.findField(Test.class, Integer.class).getName(), is("boxed")); }