@Test public void shouldCheckInvalidCases() { assertFalse(PhoneticAttributeMetadata.isValid(Arrays.asList(FirstLetterConsonant, FirstLetterVowel))); assertFalse(PhoneticAttributeMetadata.isValid(Arrays.asList(LastLetterConsonant, LastLetterVowel))); assertFalse(PhoneticAttributeMetadata.isValid(Arrays.asList(LastLetterVowel, LastVowelBack, LastVowelRounded, LastLetterNotVoiceless, HasNoVowel))); assertFalse(PhoneticAttributeMetadata.isValid(Arrays.asList(FirstLetterConsonant, LastLetterConsonant, HasNoVowel))); }
public static boolean isValid(Collection<PhoneticAttribute> phoneticAttributes) { if (CollectionUtils.isEmpty(phoneticAttributes)) return false; for (PhoneticAttribute phoneticAttribute : phoneticAttributes) { final Specification<Collection<PhoneticAttribute>> specification = SPECIFICATION_MAP.get(phoneticAttribute); if (!specification.isSatisfiedBy(phoneticAttributes)) return false; } return true; }
PhoneticAttributeMetadata { public static boolean isValid(Collection<PhoneticAttribute> phoneticAttributes) { if (CollectionUtils.isEmpty(phoneticAttributes)) return false; for (PhoneticAttribute phoneticAttribute : phoneticAttributes) { final Specification<Collection<PhoneticAttribute>> specification = SPECIFICATION_MAP.get(phoneticAttribute); if (!specification.isSatisfiedBy(phoneticAttributes)) return false; } return true; } }
PhoneticAttributeMetadata { public static boolean isValid(Collection<PhoneticAttribute> phoneticAttributes) { if (CollectionUtils.isEmpty(phoneticAttributes)) return false; for (PhoneticAttribute phoneticAttribute : phoneticAttributes) { final Specification<Collection<PhoneticAttribute>> specification = SPECIFICATION_MAP.get(phoneticAttribute); if (!specification.isSatisfiedBy(phoneticAttributes)) return false; } return true; }  }
PhoneticAttributeMetadata { public static boolean isValid(Collection<PhoneticAttribute> phoneticAttributes) { if (CollectionUtils.isEmpty(phoneticAttributes)) return false; for (PhoneticAttribute phoneticAttribute : phoneticAttributes) { final Specification<Collection<PhoneticAttribute>> specification = SPECIFICATION_MAP.get(phoneticAttribute); if (!specification.isSatisfiedBy(phoneticAttributes)) return false; } return true; }  static boolean isValid(Collection<PhoneticAttribute> phoneticAttributes); }
PhoneticAttributeMetadata { public static boolean isValid(Collection<PhoneticAttribute> phoneticAttributes) { if (CollectionUtils.isEmpty(phoneticAttributes)) return false; for (PhoneticAttribute phoneticAttribute : phoneticAttributes) { final Specification<Collection<PhoneticAttribute>> specification = SPECIFICATION_MAP.get(phoneticAttribute); if (!specification.isSatisfiedBy(phoneticAttributes)) return false; } return true; }  static boolean isValid(Collection<PhoneticAttribute> phoneticAttributes);  }