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;
}

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 ; }
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
