DefaultMessages extends AbstractMessages implements Messages { @Override public Iterable<String> keys(Locale locale) { return cachedKeysByLocale.getUnchecked(locale); } DefaultMessages(String baseName);  DefaultMessages(String baseName, Charset charset); String getBaseName(); Charset getCharset(); @Override String getMessage(String key, MessageParams params, Locale locale); @Override Iterable<String> keys(Locale locale); @Override Iterable<String> keys(); @Override Iterable<Entry<String, String>> entries(Locale locale); @Override String getMessageTemplate(String key, Locale locale); @Override String toString();  }
@Test public void should_list_keys() throws Exception { DefaultMessages m = new DefaultMessages("restx.i18n.test"); assertThat(m.keys()).containsOnly("key1", "key2"); }