<commit_before>package br.com.github.java8.lambda;

public class UseComparator {

    public static void main(String[] args) {

    }
}<commit_msg>Added lambda and functional interface examples<commit_after>package br.com.github.java8.lambda;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;

public class UseComparator {

    public static void main(String[] args) {

        List<String> strings = Arrays.asList(
            "AAA", "bbb", "CCC", "dddd", "EEEE"
        );

        Collections.sort(strings);
        System.out.println(String.format("Case sensitive sort: %s", strings));

        /*Collections.sort(strings, new Comparator<String>() {
            @Override
            public int compare(String str1, String str2) {
                return str1.compareToIgnoreCase(str2);
            }
        });*/

        /*Collections.sort(strings, (str1, str2) -> str1.compareToIgnoreCase(str2));*/

        Collections.sort(strings, String::compareToIgnoreCase);
        System.out.println(String.format("Case insensitive sort: %s", strings));
    }
}
{'fraction_non_alphanumeric': 0.12959558823529413, 'fraction_numerical': 0.009191176470588236, 'mean_word_length': 2.931407942238267, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, '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': '6238', 'n_tokens_mistral': 318, 'n_tokens_neox': 306, 'n_words': 68}