BigFractionFormat extends AbstractFormat implements Serializable { public StringBuffer format(final BigFraction BigFraction, final StringBuffer toAppendTo, final FieldPosition pos) { pos.setBeginIndex(0); pos.setEndIndex(0); getNumeratorFormat().format(BigFraction.getNumerator(), toAppendTo, pos); toAppendTo.append(" / "); getDenominatorFormat().format(BigFraction.getDenominator(), toAppendTo, pos); return toAppendTo; } BigFractionFormat();  BigFractionFormat(final NumberFormat format);  BigFractionFormat(final NumberFormat numeratorFormat,
                             final NumberFormat denominatorFormat); static Locale[] getAvailableLocales(); static String formatBigFraction(final BigFraction f); static BigFractionFormat getImproperInstance(); static BigFractionFormat getImproperInstance(final Locale locale); static BigFractionFormat getProperInstance(); static BigFractionFormat getProperInstance(final Locale locale); StringBuffer format(final BigFraction BigFraction,
                               final StringBuffer toAppendTo, final FieldPosition pos); @Override StringBuffer format(final Object obj,
                               final StringBuffer toAppendTo, final FieldPosition pos); @Override BigFraction parse(final String source); @Override BigFraction parse(final String source, final ParsePosition pos);  }
@Test public void testFormat() { BigFraction c = new BigFraction(1, 2); String expected = "1 / 2"; String actual = properFormat.format(c); Assert.assertEquals(expected, actual); actual = improperFormat.format(c); Assert.assertEquals(expected, actual); }
@Test public void testFormatNegative() { BigFraction c = new BigFraction(-1, 2); String expected = "-1 / 2"; String actual = properFormat.format(c); Assert.assertEquals(expected, actual); actual = improperFormat.format(c); Assert.assertEquals(expected, actual); }
@Test public void testFormatZero() { BigFraction c = new BigFraction(0, 1); String expected = "0 / 1"; String actual = properFormat.format(c); Assert.assertEquals(expected, actual); actual = improperFormat.format(c); Assert.assertEquals(expected, actual); }
@Test public void testFormatImproper() { BigFraction c = new BigFraction(5, 3); String actual = properFormat.format(c); Assert.assertEquals("1 2 / 3", actual); actual = improperFormat.format(c); Assert.assertEquals("5 / 3", actual); }
@Test public void testFormatImproperNegative() { BigFraction c = new BigFraction(-5, 3); String actual = properFormat.format(c); Assert.assertEquals("-1 2 / 3", actual); actual = improperFormat.format(c); Assert.assertEquals("-5 / 3", actual); }
@Test public void testLongFormat() { Assert.assertEquals("10 / 1", improperFormat.format(10l)); }
@Test public void testDoubleFormat() { Assert.assertEquals("1 / 16", improperFormat.format(0.0625)); }