ParenthesesProcessor implements SearchStringProcessor { @Override public boolean canProcess(String searchString) { if (searchString.contains("(") && searchString.contains(")")) { String pattern1_compound = ".{0,100}\\(.{1,100}\\)\\S{1,100}.{0,100}"; String pattern2_compound = ".{0,100}\\S{1,100}\\(.{1,100}\\).{0,100}"; if (!(Pattern.matches(pattern1_compound, searchString) || Pattern.matches(pattern2_compound, searchString))) { return true; } } return false; }  @Override float getBoostFactor(); @Override boolean canProcess(String searchString); @Override List<String> processSearchString(String searchString);  }
@Test public void testNoBrackets() { assertFalse(processor.canProcess(noBrackets)); }
@Test public void testHyperploidyExample() { try { assertFalse(processor.canProcess(hyperploidyExample)); } catch(Exception e) { e.printStackTrace(); fail(); } }