question: private static RoadPermission roadFlagComparision ( Way iosmWay , String newTag , String newValue , EnumSet < EdgeStore . EdgeFlag > forwardExpected , EnumSet < EdgeStore . EdgeFlag > backwardExpected ) { Way osmWay = new Way ( ) ; StringJoiner stringJoiner = new StringJoiner ( ";" ) ; for ( OSMEntity . Tag tag : iosmWay . tags ) { osmWay . addTag ( tag . key , tag . value ) ; stringJoiner . add ( tag . key + "=" + tag . value ) ; } if ( newTag != null && newValue != null ) { osmWay . addTag ( newTag , newValue ) ; stringJoiner . add ( newTag + "=" + newValue ) ; } Set < EdgeStore . EdgeFlag > forwardFiltered ; Set < EdgeStore . EdgeFlag > backwardFiltered ; RoadPermission roadPermission = traversalPermissionLabeler . getPermissions ( osmWay ) ; forwardFiltered = filterFlags ( roadPermission . forward ) ; backwardFiltered = filterFlags ( roadPermission . backward ) ; String tags = "Tags: " + stringJoiner . toString ( ) ; assertEquals ( tags , forwardExpected , forwardFiltered ) ; assertEquals ( tags , backwardExpected , backwardFiltered ) ; return roadPermission ; }
target:  Makes comparision of way with osmWay tags and newTag with newValue and compares forward and backward permissions with expected permissions Copy of osmWay is made since otherwise tags would be changed