TwitterOauth { public static String getSigningKey(String consumerSecret, String tokenSecret) { StringBuilder sb = new StringBuilder(); sb.append(percentEncode(consumerSecret)); sb.append("&"); sb.append(percentEncode(tokenSecret)); return sb.toString(); }  static String getOautHeaderString(Credentials credentials, String method, String baseUrl, Map<String, String> params); static String getOautHeaderString(Credentials credentials, String method, String baseUrl, Map<String, String> params, String nonce, int time); static String getOautHeaderString(String consumerKey, String signature, String accessToken, String nonce, int time); static String percentEncode(String s); static String getSignatureBaseString(String method, String baseUrl, String collectedParams); static String getSigningKey(String consumerSecret, String tokenSecret); static String getHmacSha1(String data, String key); static String collectOauthParams(Map<String, String> params,
                                            String consumerKey,
                                            String nonce,
                                            int timestamp,
                                            String token);  }
@Test public void testCreateSigningKey() { String consumerSecret = "kAcSOqF21Fu85e7zjz7ZN2U4ZRhfV3WpwPAoE3Z7kBw"; String tokenSecret = "LswwdoUaIvS8ltyTt5jkRh4J50vUPVVHtR2YPi5kE"; String expected = "kAcSOqF21Fu85e7zjz7ZN2U4ZRhfV3WpwPAoE3Z7kBw&LswwdoUaIvS8ltyTt5jkRh4J50vUPVVHtR2YPi5kE"; Assert.assertEquals(expected, TwitterOauth.getSigningKey(consumerSecret, tokenSecret)); }