Java library and runtime system for efficient state machine replication