How to override a class? Want to include turn_costs_calc branch

I am using GitHub - geofabrik/OpenRailRouting: routing on railway tracks using OpenStreetMap data and the GraphHopper routing engine, but I want to override some classes like AlternativeRoute. How can I achieve that? My end goal is to add these changes Comparing master...turn_costs_calc · graphhopper/graphhopper · GitHub to OpenRailRouting

You probably want to create a fork and modify the code as you need.