JSBML is a community-driven project to create a free, open-source, pure Java™ library for reading, writing, and manipulating SBML files (the Systems Biology Markup Language) and data streams. It is an alternative to the mixed Java/native code-based interface provided in libSBML.
@Test
public void test() {
var m = new Model(3,2);
var fbcPlugin = (FBCModelPlugin) m.getPlugin(FBCConstants.shortLabel);
var o1 = fbcPlugin.createObjective("obj1");
fbcPlugin.setActiveObjective(o1);
fbcPlugin.getListOfObjectives().removeAll(fbcPlugin.getListOfObjectives());
assertTrue(fbcPlugin.isSetActiveObjective());
assertEquals("obj1", fbcPlugin.getActiveObjective());
assertEquals(0, fbcPlugin.getObjectiveCount());
}
Test to reproduce: