BasicTimelineFilter implements TimelineFilter { static String normalizeHandle(String handle) { if (TextUtils.isEmpty(handle)) { return handle; } final char firstChar = handle.charAt(0); if (firstChar == '@' || firstChar == '\uFF20') { handle = handle.substring(1, handle.length()); } return handle.toLowerCase(Locale.US); } BasicTimelineFilter(FilterValues filterValues);  BasicTimelineFilter(FilterValues filterValues, Locale locale); @Override List<Tweet> filter(List<Tweet> tweets); @Override int totalFilters();  }
@Test public void testNormalizeHandle() { String twitterHandle = "@twitter"; String normalizedHandle = BasicTimelineFilter.normalizeHandle(twitterHandle); assertEquals("twitter", normalizedHandle); twitterHandle = "＠twitter"; normalizedHandle = BasicTimelineFilter.normalizeHandle(twitterHandle); assertEquals("twitter", normalizedHandle); }
@Test public void testNormalizeHandleWithoutAtSign() { final String twitterHandle = "twiTTer"; final String normalizedHandle = BasicTimelineFilter.normalizeHandle(twitterHandle); assertEquals("twitter", normalizedHandle); }