private static boolean comparePublicNonFinalFields(
            @NotNull Object first,
            @NotNull Object second,
            @Nullable Predicate<Field> acceptPredicate
    ) {
        Set<Field> firstFields = ContainerUtil.newHashSet(first.getClass().getFields());

        for (Field field : second.getClass().getFields()) {
            if (firstFields.contains(field)) {
                if (isPublic(field) && !isFinal(field) && (acceptPredicate == null || acceptPredicate.test(field))) {
                    try {
                        if (!Comparing.equal(field.get(first), field.get(second))) {
                            return false;
                        }
                    }
                    catch (IllegalAccessException e) {
                        throw new RuntimeException(e);
                    }
                }
            }
        }

        return true;
    }
private static boolean comparePublicNonFinalFields(
            @NotNull Object first,
            @NotNull Object second,
            @Nullable Predicate<Field> acceptPredicate
    )