我要删除矩阵的行数,使其行数与另一个矩阵相同
例如:
import org.junit.Test;
import org.junit.runner.RunWith;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
import static org.junit.Assert.assertNotNull;
import static org.powermock.api.mockito.PowerMockito.mock;
import static org.powermock.api.mockito.PowerMockito.whenNew;
@RunWith(PowerMockRunner.class) // delegate test running to PowerMock
@PrepareForTest(OuterClass.class) // mark classes for instrumentation so magic can happen
public class InnerClassTest {
@Test
public void shouldNotThrowException() throws Exception { // oh, the puns!
// make a mockery of our inner class
OuterClass.InnerClass innerClassMock = mock(OuterClass.InnerClass.class);
// magically return the mock when a new instance is required
whenNew(OuterClass.InnerClass.class).withAnyArguments().thenReturn(innerClassMock);
// yey, no UnsupportedOperationException here!
OuterClass outerClass = new OuterClass();
assertNotNull(outerClass);
}
}
我该怎么做才能变成
a = [ 1 2
3 4
5 6 ]
b = [7 8]
答案 0 :(得分:4)