왜 컴파일되지 않습니까? 오, 어떻게해야합니까? 코멘트에서 복사 import static org.junit.Assert.assertThat;
import static org.junit.matchers.JUnitMatchers.hasItems;
ArrayList<Integer> actual = new ArrayList<Integer>();
ArrayL
저는 matchers에 비교적 익숙하지 않습니다. 나는 JUnit과 함께 hamcrest을 가지고 놀고 있는데, 나는 그것을 좋아한다. 여러 선택 사항 중 하나가 맞음을 설명하는 방법이 있습니까? assertThat(result, is(either(1, or(2, or(3))))) //does not work in hamcrest
방법 I는 반환에게 컬
일부 String 일치를 수행하는 Java 프로그램이 있습니다. 문자열에 \d+x\d+과 일치하는 것을 찾고 있습니다. 이 작업은 Pattern 및 Matcher 클래스를 사용하여 작동합니다. 그러나 내가 찾은 String 부분을 구문 분석하려면 Matcher.find()과 Matcher.group()에서 수동으로 String을 파싱해야합니다. 어떻게하면