PropertySources { public static <T> PropertySourceChain fromConstantsClass(Class<T> constantsClass) { return fromConstantsClass(constantsClass, null); }  static PropertySourceChain from(PropertySource source); static PropertySourceChain from(PropertySource source, Func1<String, String> transformer); static PropertySourceChain fromConstantsClass(Class<T> constantsClass); static PropertySourceChain fromConstantsClass(Class<T> constantsClass, Func1<String, String> transformer); static PropertySourceChain fromComputed(Func1<String, String> computation); static PropertySourceChain fromComputed(Func1<String, String> computation, Func1<String, String> transformer); static PropertySourceChain fromEnvironment(); static PropertySourceChain fromEnvironment(Func1<String, String> transformer); static PropertySourceChain fromFile(String path); static PropertySourceChain fromFile(String path, Func1<String, String> transformer); static PropertySourceChain fromImmediate(Action1<ImmediatePropertySource> initializer); static PropertySourceChain fromImmediate(
            Action1<ImmediatePropertySource> initializer,
            Func1<String, String> transformer); static PropertySourceChain fromSystem(); static PropertySourceChain fromSystem(Func1<String, String> transformer);  }
@Test public void constantClasses() { assertEquals("value", PropertySources.fromConstantsClass(ConstantsClass.class).get(ConstantsClass.property).get()); assertFalse(PropertySources.fromConstantsClass(ConstantsClass.class).get("property2").isPresent()); assertFalse(PropertySources.fromConstantsClass(ConstantsClass.class).get("config/instance").isPresent()); assertEquals("publicValue", PropertySources.fromConstantsClass(ConstantsClass.class).get(ConstantsClass.publicProperty).get()); assertEquals("privateValue", PropertySources.fromConstantsClass(ConstantsClass.class).get(ConstantsClass.privateProperty).get()); assertEquals("nonFinalValue", PropertySources.fromConstantsClass(ConstantsClass.class).get(ConstantsClass.nonFinalProperty).get()); assertEquals("1", PropertySources.fromConstantsClass(ConstantsClass.class).get(ConstantsClass.integerProperty).get()); assertEquals("true", PropertySources.fromConstantsClass(ConstantsClass.class).get(ConstantsClass.booleanProperty).get()); assertEquals("value", PropertySources.fromConstantsClass(ConstantsClass.class).getRequired("config/property").asString()); assertEquals("ifacePublic", PropertySources.fromConstantsClass(ConstantsClass.class).orConstantsClass(ConstantsInterface.class).get(ConstantsInterface.IFACE_PUBLIC_TEST).get()); assertEquals("2", PropertySources.fromConstantsClass(ConstantsClass.class).orConstantsClass(ConstantsInterface.class).get(ConstantsInterface.IFACE_INTEGER).get()); assertEquals("true", PropertySources.fromConstantsClass(ConstantsClass.class).orConstantsClass(ConstantsInterface.class).get(ConstantsInterface.IFACE_BOOLEAN).get()); assertEquals("true", PropertySources.fromConstantsClass(ConstantsClass.class).orConstantsClass(ConstantsInterface.class).get(ConstantsClass.booleanProperty).get()); }