private static IntMap<String> generateConstantMap(Class<?> ... classes) {
        IntMap<String> constMap = new IntMap<>();
        for (Class<?> clazz : classes) {
            for (Field field : clazz.getFields()) {
                if (field.getType() == int.class) {
                    try {
                        int val = field.getInt(null);
                        String name = field.getName();
                        constMap.put(val, name);
                    } catch (IllegalArgumentException
                            | IllegalAccessException ex) {
                    }
                }
            }
        }
        // GL_ONE is more common than GL_TRUE (which is a boolean anyway)
        constMap.put(1, "GL_ONE");
        return constMap;
    }
Utility class that allows tracing of OpenGL calls generated by the engine.

@author Kirill Vainer
jme3-core/src/main/java/com/jme3/renderer/opengl/GLTracer.java