Java port: first portion (domain, domain tests, infrastructure)