Port to Frege from Java