@Test public void doubleReturnedAsItself() { Double input = 0.1; Double output = converter.apply(input); assertThat(output).isEqualTo(0.1); }
@Override public Double apply(Object input) { if (input instanceof Double) return (Double) input; if (input instanceof Number) return ((Number) input).doubleValue(); throw new IllegalArgumentException(format("There is no converter from [%s] to Double ", input.getClass().getName())); }
ObjectToDouble implements Function<Object, Double> { @Override public Double apply(Object input) { if (input instanceof Double) return (Double) input; if (input instanceof Number) return ((Number) input).doubleValue(); throw new IllegalArgumentException(format("There is no converter from [%s] to Double ", input.getClass().getName())); } }
ObjectToDouble implements Function<Object, Double> { @Override public Double apply(Object input) { if (input instanceof Double) return (Double) input; if (input instanceof Number) return ((Number) input).doubleValue(); throw new IllegalArgumentException(format("There is no converter from [%s] to Double ", input.getClass().getName())); }  }
ObjectToDouble implements Function<Object, Double> { @Override public Double apply(Object input) { if (input instanceof Double) return (Double) input; if (input instanceof Number) return ((Number) input).doubleValue(); throw new IllegalArgumentException(format("There is no converter from [%s] to Double ", input.getClass().getName())); }  @Override Double apply(Object input); }
ObjectToDouble implements Function<Object, Double> { @Override public Double apply(Object input) { if (input instanceof Double) return (Double) input; if (input instanceof Number) return ((Number) input).doubleValue(); throw new IllegalArgumentException(format("There is no converter from [%s] to Double ", input.getClass().getName())); }  @Override Double apply(Object input);  }