I need a newbie's introduction to junit: What does jUnit actually do?

I am just starting out in Teams for Education. I notice that there are some useful assessment tools to test for I/O and stuff, and I am interested in the Unit tests, since I would like to test my student’s functions for boundary conditions and the like.

However, I have no idea what the intent is of jUnit. So, I will submit my use case, and you can tell me if this is do-able.

A student in grade 10, who isn’t yet making their own classes, creates functions in replit which return a value. Of course they are writing these in class Main, and are told to declare them as “public static” before their return type.

Can I test those functions in jUnit? I would suppose that I have to declare a “Main” object variable with something like

Main m = new Main();
// Main has a public static int function called x
int q = m.x(99); // call a function x inside of Main.

… to call the functions inside of it. Is anything I am saying on the same planet as anyone else who is properly using jUnit? Otherwise, what is jUnit good for?

I have no clue about jUnit, and its documentation appears to lack a brief summary of what it is meant to test and who would be interested in using it, so I would appreciate a “basic-level” answer. The above code would work well for a testbed, but I would have to copy/paste it into each one of my student’s projects. I am hoping that jUnit would automate this, but my attempts at doing the same thing under jUnit have failed.