fixed the issues raised and added junits
usage is
ConfigurationsService configService = sling.getService(ConfigurationsService.class);
Configuration config1 = configService.getConfiguration(currentPage,"/etc/acs-commons/config/config/es-config");

config1.getRowByKey("loginpath").get("value")

If the loginpath key is not present in es-config, it will fetch from config