PercentageParser { public static boolean isRelative(final String value) { final char pre = value.charAt(0); return (pre == '+') || (pre == '-'); } private  PercentageParser(); static float parse(final String value); static boolean isRelative(final String value);  }
@Test public void testIsRelative() throws Exception { final float rate1 = 97.34f; Assert.assertFalse(PercentageParser.isRelative(rate1 + "%")); final float rate2 = 13f; Assert.assertTrue(PercentageParser.isRelative("-" + rate2 + "%")); final float rate3 = 27.2f; Assert.assertTrue(PercentageParser.isRelative("+ " + rate3 + "%")); }