### Question:
ArcController extends AbstractPetriNetComponentController<Arc<S, T>> { public void setWeights(Map<String, String> newWeights) throws UnparsableException { throwExceptionIfWeightsNotValid(newWeights); List<UndoableEdit> edits = new LinkedList<>(); for (Map.Entry<String, String> entry : newWeights.entrySet()) { edits.add(updateWeightForArc(entry.getKey(), entry.getValue())); } registerUndoableEdit(new MultipleEdit(edits)); } ArcController(Arc<S, T> arc, PetriNetController petriNetController, UndoableEditListener listener); void setWeight(String token, String expr); void setWeights(Map<String, String> newWeights); String getWeightForToken(String token); Connectable getTarget(); void toggleArcPointType(ArcPoint arcPoint); void splitArcPoint(ArcPoint arcPoint); void addPoint(Point2D point); void deletePoint(ArcPoint point);  }### Answer:
@Test public void throwsUnparsableExceptionForNonIntegerWeights() throws UnparsableException { Map<String, String> tokenWeights = new HashMap<>(); FunctionalResults<Double> result = new FunctionalResults<>(5.2, new HashSet<String>()); when(mockPetriNetController.parseFunctionalExpression(anyString())).thenReturn(result); exception.expect(UnparsableException.class); exception.expectMessage("Value is not an integer, please surround expression with floor or ceil"); tokenWeights.put(DEFAULT_TOKEN_ID, "5.2"); controller.setWeights(tokenWeights); }
@Test public void throwsUnparsableExceptionForErrorInWeights() throws UnparsableException { Map<String, String> tokenWeights = new HashMap<>(); List<String> errors = new LinkedList<>(); errors.add("test error"); FunctionalResults<Double> result = new FunctionalResults<>(5.0, errors, new HashSet<String>()); when(mockPetriNetController.parseFunctionalExpression(anyString())).thenReturn(result); exception.expect(UnparsableException.class); exception.expectMessage("test error"); tokenWeights.put(DEFAULT_TOKEN_ID, "5.2"); controller.setWeights(tokenWeights); }