1     static $type$[] [[TEST]]($type$[] a, $type$[] b, int origin, int part, boolean[] mask, int idx) {
 2         $type$[] res = new $type$[SPECIES.length()];
 3         for (int i = 0, j = 0; i < SPECIES.length(); i++){
 4             if(i+origin < SPECIES.length())
 5                 res[i] = b[idx+i+origin];
 6             else {
 7                 res[i] = b[idx+j];
 8                 j++;
 9             }
10         }
11         for (int i = 0; i < SPECIES.length(); i++){
12             res[i] = mask[i] ? a[idx+i] : res[i];
13         }
14         $type$[] res1 = new $type$[SPECIES.length()];
15         if (part == 0) {
16             for (int i = 0, j = 0; i < SPECIES.length(); i++){
17                 if (i < origin)
18                     res1[i] = b[idx+i];
19                 else {
20                    res1[i] = res[j];
21                    j++;
22                 }
23             }
24         } else if (part == 1) {
25             for (int i = 0, j = 0; i < SPECIES.length(); i++){
26                 if (i < origin)
27                     res1[i] = res[SPECIES.length()-origin+i];
28                 else {
29                     res1[i] = b[idx+origin+j];
30                     j++;
31                 }
32             }
33         }
34         return res1;
35     }
36 
37     @Test(dataProvider = "$type$BinaryOpMaskProvider")
38     static void [[TEST]]$vectorteststype$Masked(IntFunction<$type$[]> fa, IntFunction<$type$[]> fb,
39     IntFunction<boolean[]> fm) {
40 [[KERNEL]]
41         assertArraysEquals(r, a, b, origin, part, mask, $vectorteststype$::[[TEST]]);
42     }