valid = true; try { boat.validate(); } catch (RuleViolationException e) { valid = false; } assertTrue(valid);
	public void testValidate() {		Boat boat = new Boat(Boat.DOUBLE_SCULLS);		try {			boat.setTeam(doubleScullsTeam);		} catch (IncompatibleTeamException e2) {			fail("incompatible team");		}		// Test RuleNotFound				boolean valid = true;		try {			boat.validate();		} catch (RuleViolationException e) {			valid = false;		}		assertFalse(valid);				try {			RulesManager.getInstance().registerRule(BoatRule.class);			RulesManager.getInstance().registerRule(LightweightRule.class);		} catch (Exception e1) {			fail("Rule registration failed");		}		// Test RuleNotFound				valid = true;		boat.setLightweight(true);		try {			boat.validate();		} catch (RuleViolationException e) {			valid = false;		}		assertTrue(valid);	}