class Parser {

    Bond decideBond(final Bond a, final Bond b, int pos, CharBuffer buffer) throws InvalidSmilesException {
        if (a == b)
            return a;
        else if (a == Bond.IMPLICIT)
            return b;
        else if (b == Bond.IMPLICIT)
            return a;
        if (strict || a.inverse() != b)
            throw new InvalidSmilesException("Ring closure bonds did not match,  '" + a + "'!='" + b + "':" +
                                             InvalidSmilesException.display(buffer,
                                                                            pos-buffer.position,
                                                     lastBondPos-buffer.position));
        warnings.add("Ignored invalid Cis/Trans on ring closure, should flip:" +
                      InvalidSmilesException.display(buffer, pos-buffer.position,
                                                     lastBondPos-buffer.position));
        return Bond.IMPLICIT;
    }

      Parser(CharBuffer buffer, boolean strict);
      Parser(String str);

}