@Test
public void testFromBean() throws Exception {

    Example e = new Example() {
        @Override
        public Supplier<String> getHost() {
            return Suppliers.ofInstance("hello");
        }
        @Override
        public int getPort() {
            return 90;
        }
        @Override
        public String getUser() {
            return "admin";
        }
        @Override
        public boolean isAuto() {
            return true;
        }
        @Override
        public Optional<String> alias() {
            return Optional.of("demo");
        }
    };
    Config c = ConfigFactory.fromBean(Example.class, e);
    assertEquals("hello", c.getString("host").get());
    assertEquals(90, c.getInteger("port").get().intValue());
    assertEquals(true, c.getBoolean("auto").get().booleanValue());
    assertEquals("demo", c.getString("alias").get());
}