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();
    }

}
@@ -60,81 +60,8 @@
 t;%0A%0A
-import java.util.function.Function;%0Aimport java.util.function.Supplier;%0A%0A
 publ
@@ -202,25 +202,16 @@
         
-function(
 Unchecke
@@ -221,16 +221,34 @@
 unction.
+%3CInteger, Integer%3E
 unchecke
@@ -295,32 +295,40 @@
 (%22%22);%0A        %7D)
+.apply(1
 );%0A    %7D%0A%0A    @T
@@ -439,25 +439,16 @@
         
-supplier(
 Unchecke
@@ -458,16 +458,25 @@
 upplier.
+%3CInteger%3E
 unchecke
@@ -536,185 +536,8 @@
   %7D)
-);%0A    %7D%0A%0A    private Integer function(Function%3CInteger, Integer%3E fn) %7B%0A        return fn.apply(1);%0A    %7D%0A%0A    private Integer supplier(Supplier%3CInteger%3E fn) %7B%0A        return fn
 .get

Simplifica teste