HttpParameters implements Map<String, SortedSet<String>>, Serializable { public HttpParameters getOAuthParameters() { HttpParameters oauthParams = new HttpParameters(); for (Entry<String, SortedSet<String>> param : this.entrySet()) { String key = param.getKey(); if (key.startsWith("oauth_") || key.startsWith("x_oauth_")) { oauthParams.put(key, param.getValue()); } } return oauthParams; }  SortedSet<String> put(String key, SortedSet<String> value); SortedSet<String> put(String key, SortedSet<String> values, boolean percentEncode); String put(String key, String value); String put(String key, String value, boolean percentEncode); String putNull(String key, String nullString); void putAll(Map<? extends String, ? extends SortedSet<String>> m); void putAll(Map<? extends String, ? extends SortedSet<String>> m, boolean percentEncode); void putAll(String[] keyValuePairs, boolean percentEncode); void putMap(Map<String, List<String>> m); SortedSet<String> get(Object key); String getFirst(Object key); String getFirst(Object key, boolean percentDecode); String getAsQueryString(Object key); String getAsQueryString(Object key, boolean percentEncode); String getAsHeaderElement(String key); boolean containsKey(Object key); boolean containsValue(Object value); int size(); boolean isEmpty(); void clear(); SortedSet<String> remove(Object key); Set<String> keySet(); Collection<SortedSet<String>> values(); Set<Entry<String, SortedSet<String>>> entrySet(); HttpParameters getOAuthParameters();  }
@Test public void testGetOAuthParameters() { HttpParameters params = new HttpParameters(); params.put("a", "5"); params.put("oauth_token", "1"); params.put("x_oauth_token", "1"); HttpParameters oauthParams = params.getOAuthParameters(); assertFalse(oauthParams.containsKey("a")); assertTrue(oauthParams.containsKey("oauth_token")); assertTrue(oauthParams.containsKey("x_oauth_token")); }