Prevent NPE in unit test