### Question:
AbstractWeighting implements Weighting { @Override public String toString() { return getName() + "|" + flagEncoder; } protected  AbstractWeighting(FlagEncoder encoder); @Override long calcMillis(EdgeIteratorState edgeState, boolean reverse, int prevOrNextEdgeId); @Override boolean matches(HintsMap reqMap); @Override FlagEncoder getFlagEncoder(); @Override int hashCode(); @Override boolean equals(Object obj); static String weightingToFileName(Weighting w); @Override String toString();  }### Answer:
@Test public void testToString() { assertTrue(AbstractWeighting.isValidName("blup")); assertTrue(AbstractWeighting.isValidName("blup_a")); assertTrue(AbstractWeighting.isValidName("blup|a")); assertFalse(AbstractWeighting.isValidName("Blup")); assertFalse(AbstractWeighting.isValidName("Blup!")); }