First we look up the exception in the Java API documentation:
public class IllegalMonitorStateException extends RuntimeException Thrown to indicate that a thread has attempted to wait on an object's monitor or to notify other threads waiting on an object's monitor without owning the specified monitor.
The exception is thrown to indicate the thread does not own the monitor. Therefore, if the exception is thrown, the thread does not own the monitor. Therefore, if the thread owns the monitor, the exception will not be thrown.