PropertyUtil { public static String get(final String propertyName) { return get(new Locale(getDefaultLanguage()), propertyName, "--" + propertyName + "--"); }  static String[] getSupportedLocales(); static String getDefaultLocale(); static String[] getSupportedLanguages(); static String getDefaultLanguage(); static void setLogger(Logger logger); static void loadProperties(final String propertiesFile); static void loadProperties(final String propertiesFile, final boolean overwrite); static void clearProperties(); static String getNecessary(final String propertyName); static String getNecessary(final String propertyName, final String detailMessage); static String[] getCommaSeparatedList(final String propertyName); static Map<String, String> getMap(final String propertyName); static String getOptionalNonLocalized(final String propertyName); static String getOptional(final String propertyName); static String get(final String propertyName); static String get(final String propertyName, final String defaultValue); static int getOptional(final String propertyName, final int defaultValue); static double getOptional(final String propertyName, final double defaultValue); static boolean getOptional(final String propertyName, final boolean defaultValue); static String get(final Locale locale, final String propertyName); static String get(final Locale locale, final String propertyName, final String defaultValue); static Object getLocalizableProperty(final String key); static String getWithOptionalModifier(final String key, String... modifiers); static Object getLocalizableProperty(final String key, final String defaultValue); static List<String> getPropertyNamesStartingWith(final String prefix); static List<String> getMatchingPropertyNames(final String regex); static void addProperties(final Properties props, final boolean overwrite); static void addProperties(final Properties props); static void addProperty(final String key, final String value); static void addProperty(final String key, final String value, final boolean overwrite); static void addProperty(final String key, final String value, final Locale locale); static Properties getProperties();  }
@Test public void test() { String workerCount = PropertyUtil.get("workerCount"); assertEquals("Should get 10", workerCount, "10"); String redisHostname = PropertyUtil.get("redisHostname"); assertTrue("Should get 'localhost'", redisHostname.equals("localhost")); String redisPort = PropertyUtil.get("redisPort"); assertEquals("Should get 6379", redisPort, "6379"); }