public class StartsWith implements WordFeature { private char targetChar; public StartsWith( char target ) { targetChar = target; } public boolean hasFeature( String s ) { if ( s == null || s.length() == 0 ) return false; return s.charAt(0) == targetChar; } }