@Test public void format1() { NumberFormat format = NumberFormats.format(2); assertThat(format.format(2.0), equalTo("2.00")); assertThat(format.format(Double.NaN), equalTo("NaN")); assertThat(format.format(Double.POSITIVE_INFINITY), equalTo("Infinity")); assertThat(format.format(Double.NEGATIVE_INFINITY), equalTo("-Infinity")); assertThat(NumberFormats.format(2), sameInstance(format)); }
public static NumberFormat format(int precision) { NumberFormat format = precisionFormat.get(precision); if (format == null) { precisionFormat.put(precision, createFormatter(precision)); } return precisionFormat.get(precision); }
NumberFormats { public static NumberFormat format(int precision) { NumberFormat format = precisionFormat.get(precision); if (format == null) { precisionFormat.put(precision, createFormatter(precision)); } return precisionFormat.get(precision); } }
NumberFormats { public static NumberFormat format(int precision) { NumberFormat format = precisionFormat.get(precision); if (format == null) { precisionFormat.put(precision, createFormatter(precision)); } return precisionFormat.get(precision); } private  NumberFormats(); }
NumberFormats { public static NumberFormat format(int precision) { NumberFormat format = precisionFormat.get(precision); if (format == null) { precisionFormat.put(precision, createFormatter(precision)); } return precisionFormat.get(precision); } private  NumberFormats(); static NumberFormat format(int precision); static NumberFormat toStringFormat(); }
NumberFormats { public static NumberFormat format(int precision) { NumberFormat format = precisionFormat.get(precision); if (format == null) { precisionFormat.put(precision, createFormatter(precision)); } return precisionFormat.get(precision); } private  NumberFormats(); static NumberFormat format(int precision); static NumberFormat toStringFormat();  }