关闭。这个问题需要细节或清晰。它目前不接受答案。
**想改进这个问题吗?**通过编辑这个帖子来添加细节并澄清问题。
6小时前关门了。
改进这个问题
我有这样的代码
public class PatternTest {
private boolean arrayIntEqual(int[] arr1, int[] arr2) {
if(arr1.length != arr2.length) return false;
for(int i=0; i< arr1.length; i++) {
if(arr1[i] != arr2[i]) return false;
}
return true;
}
@Test
public void testCase1() {
int[] arr = {1, 2, 3, 4, 5, 8};
int[] out = {3};
int[] output = ArrayUtils.process(arr);
assertTrue(arrayIntEqual(out, output));
}
@Test
public void testCase2() {
int[] arr = {1, 2, 3, 4, 5, 8, 6, 3, 3, 6, 10};
int[] out = {3, 6, 6};
int[] output = ArrayUtils.process(arr);
assertTrue(arrayIntEqual(out, output));
}
@Test
public void testCase7() {
int[] arr = {2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3};
int[] out = {3};
int[] output = ArrayUtils.process(arr);
assertTrue(arrayIntEqual(out, output));
}
}
如何修复此代码?我已经试着找到模式,但我无法得到修复模式请帮助我修复它。我所拥有的是为过程方法构建类
暂无答案!
目前还没有任何答案,快来回答吧!