1package com.concerned.crossbill;
2
3import java.util.Arrays;
4
5public class Foo {
6
7 public int getMin(int[] numbers) {
8 return Arrays.stream(numbers).min().getAsInt();
9 }
10}
11// test class
12import org.junit.Test;
13import static org.junit.Assert.assertEquals;
14import com.concerned.crossbill.Foo;
15
16public class FooTest {
17 public void testGetMin() {
18 int[] numbers = new int[]{12, 10, 31, 30, 23, 4, 5, 5, 5, 5, 10, 40};
19
20 Foo foo = new Foo();
21 int result = foo.getMin(numbers);
22 int expResult = 4;
23
24 assertEquals(expResult, result);
25 }
26}