protected Field[] getFields(Object obj) {
		ArrayList<Field> allFields = new ArrayList<Field>();
		ArrayList<Class<?>> classTower = this.getClasses(obj);
		// Printout to observe the shown packages

		//if(logger.isDebugEnabled())
		//	logger.debug("Object " + obj.toString() + "has " +
		//			classTower.size() + " classes in its package hierarchy");

		// System.out.println("Object " + obj.toString() + "has " +
		// classTower.size() + " classes in its package hierarchy.");

		// for (ArrayList<Class> c: classTower){
		for (Class<?> cl : classTower) {
			Field[] fields = cl.getDeclaredFields();
			for (Field f : fields) {
				// permit access to the protected and private field values
                ensureIsAccessible(f);
				int modif = f.getModifiers();
				if ( (!(Modifier.isStatic(modif)))  &&
						 (!(Modifier.isVolatile(modif))) &&
						 (!(Modifier.isTransient(modif))) &&
						 ((f.getDeclaringClass().equals(cl))) ){

					/*
					if(logger.isDebugEnabled())
						System.out.println("Field " + f.getName() +
								" in the class " +
								f.getDeclaringClass() + " added for class " +
								cl.getName());
					*/
					// System.out.println("Field " + f.getName() +
					// " in the class " +
					// f.getDeclaringClass() + " added for class " +
					// cl.getName());

					allFields.add(f);
				}
			}
		}
		// System.out.println("Object " + obj + "has " +
		// allFields.size() + " fields.");

		Field[] allFieldsArray = new Field[allFields.size()];
		return allFields.toArray(allFieldsArray);
	}