LPS-50049 Refactor portal-service unit tests
LPS-50049 Refactor portal-impl
LPS-50049 No need to flush before close
LPS-50049 Use better system api
LPS-50049 Source formatting