public static <T> Set<Class<? extends T>> getReferencedClasses(@Nullable final Object obj, @NonNull final Class<T> clazz) {
        if (obj == null) {
            return Collections.emptySet();
        }
        final Set<Class<? extends T>> result = new HashSet<>();
        try {
            final List<Field> fields = FieldUtils.getAllFieldsList(obj.getClass());
            for (Field field : fields) {
                if (clazz.isAssignableFrom(field.getType())) {
                    @SuppressWarnings("unchecked")
                    final Class<? extends T> typeClass = (Class<? extends T>) field.getType();
                    result.add(typeClass);
                }
            }
        } catch (Exception ignore) {
            //ignore
        }
        return result;

    }
executes a given action on each 'partitionSize' numer of elements of the given collection. If false is returned, action is abandoned
main/src/main/java/cgeo/geocaching/utils/CommonUtils.java