Does the main program work if ou in comment oth lines and test with both kinds of beans?  And it seems a little odd to me to have tests in a main program.  Shouldn't the tests be in a different class?