class NumberPredicate implements Predicate<String> {

    @Override
    public boolean test(String token)
    {
        boolean isValid;
        if (StringUtils.isBlank(token))
        {
            isValid = false;
        }
        else
        {
            try
            {
                Double.valueOf(token);
                // Double.valueOf allows 'd' and 'f' but we don't
                isValid = token.indexOf('d') == -1 && token.indexOf('f') == -1;
            }
            catch (NumberFormatException e)
            {
                isValid = false;
            }
        }
        return isValid;
    }

}