static private ArrayList<Field> getAllFields (Class type) {
		ArrayList<Class> classes = new ArrayList();
		Class nextClass = type;
		while (nextClass != null && nextClass != Object.class) {
			classes.add(nextClass);
			nextClass = nextClass.getSuperclass();
		}
		ArrayList<Field> allFields = new ArrayList();
		for(int i = classes.size() - 1; i >= 0; i--) {
			Collections.addAll(allFields, classes.get(i).getDeclaredFields());
		}
		return allFields;
	}