<commit_before>/*
* vwd KL
* Created by zzhao on 12/4/15 5:43 PM
*/
package com.example.util

import spock.lang.Specification
import spock.lang.Unroll

import java.util.stream.Collectors;

/**
 * @author zzhao
 */
@Unroll
class StreamUtilSpec extends Specification {

    def "#type #elements reverse streaming: #output"() {
        expect:
        StreamUtil.reverse(elements).collect(Collectors.toList()) == output

        where:
        type         | elements                | output
        'Array'      | [1, 2, 3].toArray()     | [3, 2, 1]
        'LinkedList' | [1, 2, 3] as LinkedList | [3, 2, 1]
        'List'       | [1, 2, 3]               | [3, 2, 1]
    }

    def "primes range from #from to #to: #primes"() {
        expect:
        Arrays.asList(StreamUtil
                .primeRange(from, to)
                .sorted()
                .toArray()) == primes
<commit_msg>suppress warnings<commit_after>/*
* vwd KL
* Created by zzhao on 12/4/15 5:43 PM
*/
package com.example.util

import spock.lang.Specification
import spock.lang.Unroll

import java.util.stream.Collectors;

/**
 * @author zzhao
 */
@Unroll
class StreamUtilSpec extends Specification {

    @SuppressWarnings("all")
    def "#type #elements reverse streaming: #output"() {
        expect:
        StreamUtil.reverse(elements).collect(Collectors.toList()) == output

        where:
        type         | elements                | output
        'Array'      | [1, 2, 3].toArray()     | [3, 2, 1]
        'LinkedList' | [1, 2, 3] as LinkedList | [3, 2, 1]
        'List'       | [1, 2, 3]               | [3, 2, 1]
    }

    @SuppressWarnings("all")
    def "primes range from #from to #to: #primes"() {
        expect:
        Arrays.asList(StreamUtil
                .primeRange(from, to)
                .sorted()
                .toArray()) == primes

{'fraction_non_alphanumeric': 0.13572204125950055, 'fraction_numerical': 0.02823018458197611, 'mean_word_length': 1.9069400630914826, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3104356', 'n_tokens_mistral': 641, 'n_tokens_neox': 588, 'n_words': 155}