### Question:
Path { protected long calcMillis( double distance, long flags, boolean revert ) { if (revert && !encoder.isBackward(flags) || !revert && !encoder.isForward(flags)) throw new IllegalStateException("Calculating time should not require to read speed from edge in wrong direction. " + "Reverse:" + revert + ", fwd:" + encoder.isForward(flags) + ", bwd:" + encoder.isBackward(flags)); double speed = revert ? encoder.getReverseSpeed(flags) : encoder.getSpeed(flags); if (Double.isInfinite(speed) || Double.isNaN(speed) || speed < 0) throw new IllegalStateException("Invalid speed stored in edge! " + speed); if (speed == 0) throw new IllegalStateException("Speed cannot be 0 for unblocked edge, use access properties to mark edge blocked! Should only occur for shortest path calculation. See #242."); return (long) (distance * 3600 / speed); } Path( Graph graph, FlagEncoder encoder );   Path( Path p ); Path setEdgeEntry( EdgeEntry edgeEntry ); boolean isFound(); Path setFound( boolean found ); double getDistance(); long getMillis(); long getTime(); double getWeight(); Path setWeight( double w ); Path extract(); EdgeIteratorState getFinalEdge(); long getExtractTime(); String getDebugInfo(); List<EdgeIteratorState> calcEdges(); TIntList calcNodes(); PointList calcPoints(); InstructionList calcInstructions( final Translation tr ); @Override String toString(); String toDetailsString();  }### Answer:
@Test public void testTime() { FlagEncoder tmpEnc = new Bike2WeightFlagEncoder(); GraphHopperStorage g = new GraphBuilder(new EncodingManager(tmpEnc)).create(); Path p = new Path(g, tmpEnc); long flags = tmpEnc.setSpeed(tmpEnc.setReverseSpeed(tmpEnc.setAccess(0, true, true), 10), 15); assertEquals(375 * 60 * 1000, p.calcMillis(100000, flags, false)); assertEquals(600 * 60 * 1000, p.calcMillis(100000, flags, true)); g.close(); }