Java-inspired interface validation for JavaScript