public static String queryToFetchFilteredFieldsOf(
            final AbstractDescribedSObjectBase object, final Predicate<SObjectField> filter) {
        if (object == null) {
            return null;
        }

        if (filter == null) {
            return queryToFetchAllFieldsOf(object);
        }

        final SObjectDescription description = object.description();
        final List<SObjectField> fields = description.getFields();

        return fields.stream().filter(filter).map(SObjectField::getName)
                .collect(Collectors.joining(", ", "SELECT ", " FROM " + description.getName()));
    }
@Test
    public void shouldGenerateQueryForFilteredFields() {
        String s = QueryHelper.queryToFetchFilteredFieldsOf(new Account(), SObjectField::isCustom);
        assertThat(QueryHelper.queryToFetchFilteredFieldsOf(new Account(), SObjectField::isCustom))
                .isEqualTo(
                        "SELECT Shipping_Location__Latitude__s, Shipping_Location__Longitude__s, Shipping_Location__c, External_Id__c FROM Account");
    }