UnitChange implements NormalizationRule { public UnitChange(String field, double multiplier) { ArgumentChecker.notNull(field, "Field name"); _fields = ImmutableSet.of(field); _multiplier = multiplier; } UnitChange(String field, double multiplier);  UnitChange(Set<String> fields, double multiplier);  UnitChange(double multiplier, String... fields); @Override MutableFudgeMsg apply(MutableFudgeMsg msg, String securityUniqueId, FieldHistoryStore fieldHistory);  }
@Test public void unitChange() { UnitChange unitChange = new UnitChange("Foo", 10); MutableFudgeMsg msg = OpenGammaFudgeContext.getInstance().newMessage(); msg.add("Foo", 2.0); msg.add("Bar", "2"); MutableFudgeMsg normalized = unitChange.apply(msg, "123", new FieldHistoryStore()); assertEquals(2, normalized.getAllFields().size()); assertEquals(20.0, normalized.getDouble("Foo"), 0.0001); }