class GetSortBsonVisitor implements SortFieldExpressionVisitor<String> {

    public static JsonArray sortValuesAsArray(final Document document, final List<SortOption> sortOptions) {
        final JsonArrayBuilder builder = JsonFactory.newArrayBuilder();
        sortOptions.stream()
                .map(SortOption::getSortExpression)
                .map(GetSortBsonVisitor::path)
                .map(seekToPath(document))
                .forEach(value -> builder.add(JsonValue.of(value)));
        return builder.build();
    }

    private  GetSortBsonVisitor();

}