static boolean isModern(Class<? extends LoadStatistics> clazz) {
        // cannot use Util.isOverridden as these are protected methods.
        boolean hasGetNodes = false;
        boolean hasMatches = false;
        while (clazz != LoadStatistics.class && clazz != null && !(hasGetNodes && hasMatches)) {
            if (!hasGetNodes) {
                try {
                    final Method getNodes = clazz.getDeclaredMethod("getNodes");
                    hasGetNodes = !Modifier.isAbstract(getNodes.getModifiers());
                } catch (NoSuchMethodException e) {
                    // ignore
                }
            }
            if (!hasMatches) {
                try {
                    final Method getNodes = clazz.getDeclaredMethod("matches", Queue.Item.class, SubTask.class);
                    hasMatches = !Modifier.isAbstract(getNodes.getModifiers());
                } catch (NoSuchMethodException e) {
                    // ignore
                }
            }
            if (!(hasGetNodes && hasMatches) && LoadStatistics.class.isAssignableFrom(clazz.getSuperclass())) {
                clazz = (Class<? extends LoadStatistics>) clazz.getSuperclass();
            }
        }
        return hasGetNodes && hasMatches;
    }
@Test
    public void isModernWorks() {
        assertThat(LoadStatistics.isModern(Modern.class), is(true));
        assertThat(LoadStatistics.isModern(LoadStatistics.class), is(false));
    }