### Question:
FileNamePattern extends ContextAwareBase { public String convertInt(int i) { return convert(i); } FileNamePattern(String patternArg, Context contextArg); String toString(); @Override int hashCode(); @Override boolean equals(Object obj); DateTokenConverter<Object> getPrimaryDateTokenConverter(); IntegerTokenConverter getIntegerTokenConverter(); boolean hasIntegerTokenCOnverter(); String convertMultipleArguments(Object... objectList); String convert(Object o); String convertInt(int i); void setPattern(String pattern); String getPattern(); String toRegexForFixedDate(Date date); String toRegex(); String toRegex(boolean capturePrimaryDate, boolean captureInteger);  }### Answer:
@Test public void testSmoke() { FileNamePattern pp = new FileNamePattern("t", context); assertEquals("t", pp.convertInt(3)); pp = new FileNamePattern("foo", context); assertEquals("foo", pp.convertInt(3)); pp = new FileNamePattern("%i foo", context); assertEquals("3 foo", pp.convertInt(3)); pp = new FileNamePattern("foo%i.xixo", context); assertEquals("foo3.xixo", pp.convertInt(3)); pp = new FileNamePattern("foo%i.log", context); assertEquals("foo3.log", pp.convertInt(3)); pp = new FileNamePattern("foo.%i.log", context); assertEquals("foo.3.log", pp.convertInt(3)); pp = new FileNamePattern("foo.%3i.log", context); assertEquals("foo.003.log", pp.convertInt(3)); pp = new FileNamePattern("foo.%1i.log", context); assertEquals("foo.43.log", pp.convertInt(43)); }
@Test public void flowingI() { { FileNamePattern pp = new FileNamePattern("foo%i{}bar%i", context); assertEquals("foo3bar3", pp.convertInt(3)); } { FileNamePattern pp = new FileNamePattern("foo%i{}bar%i", context); assertEquals("foo3bar3", pp.convertInt(3)); } }
@Test public void withBackslash() { FileNamePattern pp = new FileNamePattern("c:\\foo\\bar.%i", context); assertEquals("c:/foo/bar.3", pp.convertInt(3)); }