IdTools { static boolean isIRIStyleIdSuffix(String id) { int underScoreIndex = -1; final int length = id.length(); for (int i = 0; i < length; i++) { char c = id.charAt(i); if (c == '_') { underScoreIndex = i; break; } if (!Character.isLetter(c) || !Character.isUpperCase(c)) { return false; } } if (underScoreIndex <= 1) { return false; } if (length < underScoreIndex + 1) { return false; } for (int i = underScoreIndex + 1; i < length; i++) { char c = id.charAt(i); if (!Character.isDigit(c)) { return false; } } return true; }    }
@Test public void testIsIRIStyleIdSuffix() { is("BFO_0000050"); is("RO_0002313"); not("00_000"); not("part_of"); not("XX_XX"); not("XX__000"); }