public Fraction getCleanLength() { // i.e. length without dots: 1/4, 1/2, 1/6 Fraction r = length.get(); return r.getDenominator() == 1 ? new Fraction( r.getNumerator() * 2, 2) // i have doubts for this line. think about numberOfTrailingZeros() : new Fraction(r.getNumerator() + 1, r.getDenominator() * 2); }