package Ġcom . hl tech . jud ged . contracts . publisher Ċ Ċ import Ġcom . hl tech . jud ged . contracts . publisher . capabilities . Capabilities Ċ import Ġcom . hl tech . jud ged . contracts . publisher . capabilities . Capabilities Reader Factory Ċ import Ġcom . hl tech . jud ged . contracts . publisher . expect ations . Expectations Ċ import Ġcom . hl tech . jud ged . contracts . publisher . expect ations . Expectations Reader Factory Ċ import Ġcom . hl tech . jud ged . contracts . publisher . jud ged . J udge D Ċ Ċ class ĠPublisher Ġ{ ĊĊĠĠĠ Ġprivate Ġval Ġcapabilities Reader Factory Ġ= ĠCap abilities Reader Factory () ĊĠĠĠ Ġprivate Ġval Ġexpectations Reader Factory Ġ= ĠExpect ations Reader Factory () ĊĠĠĠ Ġprivate Ġval Ġjudge D Ġ= ĠJ udge D () ĊĊĠĠĠ Ġfun Ġpublish ( properties : ĠPublisher Properties ) Ġ{ ĊĠĠĠĠĠĠĠ Ġif Ġ( properties . capabilities . isEmpty () Ġ&& Ġproperties . expect ations . isEmpty ()) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprintln (" Did Ġnot Ġfound Ġany Ġcontracts Ġfor Ġpublish .") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġreturn ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġval Ġcapabilities Ġ= Ġget Capabilities From ( properties ) ĊĠĠĠĠĠĠĠ Ġval Ġexpectations Ġ= Ġget Expectations From ( properties ) ĊĠĠĠĠĠĠĠ Ġjudge D . publish Contracts ( properties , Ġcapabilities , Ġexpectations ) ĊĠĠĠĠĠĠĠ Ġprintln (" Contracts Ġsuccessfully Ġpublished .") ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġget Capabilities From ( properties : ĠPublisher Properties ): ĠList < Capabilities > Ġ= ĊĠĠĠĠĠĠĠ Ġproperties . capabilities ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. map Ġ{ Ġcapabilities Reader Factory . create ( it ). read ( properties ) Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. toList () ĊĊĠĠĠ Ġprivate Ġfun Ġget Expectations From ( properties : ĠPublisher Properties ): ĠList < Expectations > Ġ= ĊĠĠĠĠĠĠĠ Ġproperties . expect ations ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. map Ġ{ Ġexpectations Reader Factory . create ( it ). read ( properties ) Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. flatten () Ċ Ċ }