code: private int countOccurrences(final String string, char c, int offset) {
          assert string != null : "String must be specified";
          return ((offset = string.indexOf(c, offset)) == -1) ? 0 : 1 + countOccurrences(string, c, offset + 1);
      }
docs: Returns the number of occurrences of the specified character in the specified {@link String}, starting at the
  specified offset
  
  @param string
  @param c
  @param offset
  @return