InterestRateCurveSensitivityUtils { public static Map<String, List<DoublesPair>> multiplySensitivity(final Map<String, List<DoublesPair>> sensitivity, final double factor) { ArgumentChecker.notNull(sensitivity, "sensitivity"); final Map<String, List<DoublesPair>> result = new HashMap<>(); for (final Map.Entry<String, List<DoublesPair>> entry : sensitivity.entrySet()) { result.put(entry.getKey(), multiplySensitivity(entry.getValue(), factor)); } return result; } protected  InterestRateCurveSensitivityUtils(); static Map<String, List<DoublesPair>> clean(final Map<String, List<DoublesPair>> old, final double relTol, final double absTol); static List<DoublesPair> addSensitivity(final List<DoublesPair> sensi1, final List<DoublesPair> sensi2); static Map<String, List<DoublesPair>> addSensitivity(final Map<String, List<DoublesPair>> sensi1, final Map<String, List<DoublesPair>> sensi2); static Map<String, List<DoublesPair>> addSensitivity(final Map<String, List<DoublesPair>> sensi, final String curveName, final List<DoublesPair> list); static Map<String, List<DoublesPair>> addSensitivity(final Map<String, List<DoublesPair>> sensi1, final Map<String, List<DoublesPair>> sensi2, final Map<String, List<DoublesPair>> sensi3); static Map<String, List<DoublesPair>> multiplySensitivity(final Map<String, List<DoublesPair>> sensitivity, final double factor); static List<DoublesPair> multiplySensitivity(final List<DoublesPair> sensitivity, final double factor); static boolean compare(final List<DoublesPair> sensi1, final List<DoublesPair> sensi2, final double tolerance); static boolean compare(final Map<String, List<DoublesPair>> sensi1, final Map<String, List<DoublesPair>> sensi2, final double tolerance);  }
@Test public void testMultiplySensitivityList() { final List<DoublesPair> l1 = new ArrayList<>(); l1.add(DoublesPair.of(0.23, 2.3)); l1.add(DoublesPair.of(0.23, -2.6)); l1.add(DoublesPair.of(-0.35, 2.3)); final List<DoublesPair> res = multiplySensitivity(l1, 2.0); assertEquals(l1.size(), res.size()); for (int i = 0; i < res.size(); i++) { assertEquals(l1.get(i).first, res.get(i).first, 0.0); assertEquals(2.0 * l1.get(i).second, res.get(i).second, 1e-9); } }