package br.gov.servicos.editor.utils;

import org.junit.Test;

import java.util.function.Function;
import java.util.function.Supplier;

public class UncheckedTest {

    @Test(expected = Exception.class)
    public void retornaVersaoSemExcecoesDaFuncao() throws Exception {
        function(Unchecked.Function.unchecked(x -> {
            throw new Exception("");
        }));
    }

    @Test(expected = Exception.class)
    public void retornaVersaoSemExcecoesDeSupplier() throws Exception {
        supplier(Unchecked.Supplier.unchecked(() -> {
            throw new Exception("");
        }));
    }

    private Integer function(Function<Integer, Integer> fn) {
        return fn.apply(1);
    }

    private Integer supplier(Supplier<Integer> fn) {
        return fn.get();
    }

}
package br.gov.servicos.editor.utils;

import org.junit.Test;

public class UncheckedTest {

    @Test(expected = Exception.class)
    public void retornaVersaoSemExcecoesDaFuncao() throws Exception {
        Unchecked.Function.<Integer, Integer>unchecked(x -> {
            throw new Exception("");
        }).apply(1);
    }

    @Test(expected = Exception.class)
    public void retornaVersaoSemExcecoesDeSupplier() throws Exception {
        Unchecked.Supplier.<Integer>unchecked(() -> {
            throw new Exception("");
        }).get();
    }

}
Simplifica teste