TwitterApi { public static String buildUserAgent(String clientName, String version) { final StringBuilder ua = new StringBuilder(clientName) .append('/').append(version) .append(' ') .append(Build.MODEL).append('/').append(Build.VERSION.RELEASE) .append(" (") .append(Build.MANUFACTURER).append(';') .append(Build.MODEL).append(';') .append(Build.BRAND).append(';') .append(Build.PRODUCT) .append(')'); return normalizeString(ua.toString()); } TwitterApi();  TwitterApi(String baseHostUrl); String getBaseHostUrl(); Uri.Builder buildUponBaseHostUrl(String... paths); static String buildUserAgent(String clientName, String version); static final String BASE_HOST; static final String BASE_HOST_URL; }
@Test public void testBuildUserAgent() { final String clientName = "TwitterAndroidSDK"; final String version = "1.0.0.1"; final String userAgent = TwitterApi.buildUserAgent(clientName, version); assertEquals( String.format("%s/%s %s/%s (%s;%s;%s;%s)", clientName, version, Build.MODEL, Build.VERSION.RELEASE, Build.MANUFACTURER, Build.MODEL, Build.BRAND, Build.PRODUCT), userAgent); }