package com.google.common.base; import static org.junit.Assert.*; import org.junit.Test; import org.mockito.Mockito; public class TestSuppliers { @Test public void composeTest() { Function function = (Function) Mockito.mock(Function.class); Supplier supplier = (Supplier) Mockito.mock(Supplier.class); Supplier result = Suppliers.compose(function, supplier); assertNotNull(result); } @Test public void memoizeTest() { Supplier supplier = (Supplier) Mockito.mock(Supplier.class); Integer retVal = new Integer(5); Mockito.when(supplier.get()).thenReturn(retVal); supplier = Suppliers.memoize(supplier); Integer result = supplier.get(); assertEquals(retVal, result); } }