@Test public void testConvertDefault() { double mi = 1.0; double km = 1.609344; ConvertDistances converter = new ConvertDistances(); Assert.assertEquals(km, converter.convert(mi), delta); }
public double convert(double value) { if (Double.isNaN(value)) { return value; } if (from.equals(to)) { return value; } BigDecimal result = new BigDecimal(String.valueOf(value)).multiply(multiplier); return result.doubleValue(); }
ConvertDistances { public double convert(double value) { if (Double.isNaN(value)) { return value; } if (from.equals(to)) { return value; } BigDecimal result = new BigDecimal(String.valueOf(value)).multiply(multiplier); return result.doubleValue(); } }
ConvertDistances { public double convert(double value) { if (Double.isNaN(value)) { return value; } if (from.equals(to)) { return value; } BigDecimal result = new BigDecimal(String.valueOf(value)).multiply(multiplier); return result.doubleValue(); } ConvertDistances(); @Nullable  ConvertDistances(Distance from, Distance to); }
ConvertDistances { public double convert(double value) { if (Double.isNaN(value)) { return value; } if (from.equals(to)) { return value; } BigDecimal result = new BigDecimal(String.valueOf(value)).multiply(multiplier); return result.doubleValue(); } ConvertDistances(); @Nullable  ConvertDistances(Distance from, Distance to); double convert(double value); }
ConvertDistances { public double convert(double value) { if (Double.isNaN(value)) { return value; } if (from.equals(to)) { return value; } BigDecimal result = new BigDecimal(String.valueOf(value)).multiply(multiplier); return result.doubleValue(); } ConvertDistances(); @Nullable  ConvertDistances(Distance from, Distance to); double convert(double value);  }