RGroupList { public void setOccurrence(String occurrence) throws CDKException { if (occurrence == null || occurrence.equals("")) { occurrence = ">0"; } else { occurrence = occurrence.trim().replaceAll(" ", ""); if (isValidOccurrenceSyntax(occurrence)) { this.occurrence = occurrence; } else throw new CDKException("Invalid occurence line: " + occurrence); } } RGroupList(int rGroupNumber);  RGroupList(int rGroupNumber, boolean restH, String occurrence, int requiredRGroupNumber); void setRGroupNumber(int rGroupNumber); int getRGroupNumber(); void setRestH(boolean restH); boolean isRestH(); void setRequiredRGroupNumber(int rGroupNumberImplicated); int getRequiredRGroupNumber(); void setRGroups(List<RGroup> rGroups); List<RGroup> getRGroups(); String getOccurrence(); void setOccurrence(String occurrence); static boolean isValidOccurrenceSyntax(String occ); List<Integer> matchOccurence(int maxAttachments); @Override boolean equals(Object obj); @Override int hashCode(); final static String DEFAULT_OCCURRENCE; }
@Test(expected = CDKException.class) public void testOccurrenceNumericValues() throws CDKException { RGroupList rgrLst = new RGroupList(1); rgrLst.setOccurrence("a,3,10"); }
@Test(expected = CDKException.class) public void testOccurrenceNoNegativeNumber() throws CDKException { RGroupList rgrLst = new RGroupList(1); rgrLst.setOccurrence("-10"); }
@Test(expected = CDKException.class) public void testOccurrenceNotSmallerThanZero() throws CDKException { RGroupList rgrLst = new RGroupList(1); rgrLst.setOccurrence("<0"); }