### Question:
AbstractWeighting implements Weighting { @Override public String toString() { String turnCostProviderName = turnCostProvider.getName(); String result = getName() + "|" + flagEncoder; if (!isEmpty(turnCostProviderName)) { result += "|u_turn_costs=" + turnCostProviderName; } return result; } protected  AbstractWeighting(FlagEncoder encoder); protected  AbstractWeighting(FlagEncoder encoder, TurnCostProvider turnCostProvider); abstract double calcEdgeWeight(EdgeIteratorState edgeState, boolean reverse); @Override long calcEdgeMillis(EdgeIteratorState edgeState, boolean reverse); @Override double calcTurnWeight(int inEdge, int viaNode, int outEdge); @Override long calcTurnMillis(int inEdge, int viaNode, int outEdge); @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!")); }