import java.util.Arrays; public class Assess4_13_Sample{ public static int[] keep(int[] arr1, int[] arr2){ int [] result = new int[2]; return result; } public static int[] cleanResult(int[] array){ return Arrays.stream(array).filter(num -> num != 0).toArray(); } public static void main(String[] args){ int [] arr1a = {1}; int [] arr1b = {0}; int [] result1 = {1}; System.out.println("test1: " + Arrays.equals(cleanResult(keep(arr1a, arr1b)), result1)); int [] arr2a = {1}; int [] arr2b = {1}; int [] result2 = {}; System.out.println("test2: " + Arrays.equals(cleanResult(keep(arr2a, arr2b)), result2)); int [] arr3a = {}; int [] arr3b = {1}; int [] result3 = {}; System.out.println("test2: " + Arrays.equals(cleanResult(keep(arr3a, arr3b)), result3)); int [] arr4a = {1}; int [] arr4b = {}; int [] result4 = {1}; System.out.println("test4: " + Arrays.equals(cleanResult(keep(arr4a, arr4b)), result4)); int [] arr5a = {1, 2, 1, 4, 5, 3, 7}; int [] arr5b = {1, 3}; int [] result5 = {2, 4, 5, 7}; System.out.println("test4: " + Arrays.equals(cleanResult(keep(arr5a, arr5b)), result5)); } }