### Question:
FilePattern implements ResourcePattern { public static FilePattern compile(String patternString) { if (patternString == null) { throw new IllegalArgumentException("patternString must not be null"); } if (patternString.isEmpty()) { throw new IllegalArgumentException("patternString must not be empty"); } List<Segment> segments = compileSegments(patternString); return new FilePattern(segments, patternString); } FilePattern(List<Segment> segments, String patternString); Set<PatternElementKind> getPatternElementKinds(); boolean containsVariables(); boolean containsTraverse(); List<Segment> getSegments(); String getPatternString(); @Override String toString(); static FilePattern of(List<? extends Segment> segments); static FilePattern compile(String patternString);  }### Answer:
@Test(expected = IllegalArgumentException.class) public void consecutive_wildcard() { FilePattern.compile("**.csv"); }
@Test(expected = IllegalArgumentException.class) public void doller() { FilePattern.compile("$.csv"); }
@Test(expected = IllegalArgumentException.class) public void variable_unclosed() { FilePattern.compile("${csv"); }
@Test(expected = IllegalArgumentException.class) public void selection_unclosed() { FilePattern.compile("{data"); }
@Test(expected = IllegalArgumentException.class) public void selection_invalid_character() { FilePattern.compile("{*}"); }
@Test(expected = IllegalArgumentException.class) public void invalid_character() { FilePattern.compile("\\data.csv"); }