3131 * @since 2.0
3232 */
3333public class RuleTest {
34+ private static class NegativeIntegerBaseMatcher extends BaseMatcher <Integer > {
35+ public void describeTo (Description description ) {
36+ description .appendText ("value should be negative" );
37+ }
38+
39+ public boolean matches (Object item ) {
40+ return ((Integer ) item ) < 0 ;
41+ }
42+ }
43+
3444 private Rule .Phoneme [][] makePhonemes () {
3545 String [][] words = {
3646 { "rinD" , "rinDlt" , "rina" , "rinalt" , "rino" , "rinolt" , "rinu" , "rinult" },
@@ -48,15 +58,6 @@ private Rule.Phoneme[][] makePhonemes() {
4858 return phonemes ;
4959 }
5060
51- @ Test
52- public void phonemeComparedToSelfIsZero () {
53- for (Rule .Phoneme [] phs : makePhonemes ()) {
54- for (Rule .Phoneme ph : phs ) {
55- assertEquals ("Phoneme compared to itself should be zero: " + ph .getPhonemeText (), 0 , ph .compareTo (ph ));
56- }
57- }
58- }
59-
6061 @ Test
6162 public void phonemeComparedToLaterIsNegative () {
6263 for (Rule .Phoneme [] phs : makePhonemes ()) {
@@ -71,13 +72,12 @@ public void phonemeComparedToLaterIsNegative() {
7172 }
7273 }
7374
74- private static class NegativeIntegerBaseMatcher extends BaseMatcher <Integer > {
75- public boolean matches (Object item ) {
76- return ((Integer ) item ) < 0 ;
77- }
78-
79- public void describeTo (Description description ) {
80- description .appendText ("value should be negative" );
75+ @ Test
76+ public void phonemeComparedToSelfIsZero () {
77+ for (Rule .Phoneme [] phs : makePhonemes ()) {
78+ for (Rule .Phoneme ph : phs ) {
79+ assertEquals ("Phoneme compared to itself should be zero: " + ph .getPhonemeText (), 0 , ph .compareTo (ph ));
80+ }
8181 }
8282 }
8383}
0 commit comments