ServerType<S> () { //noinspection unchecked ServerType<S> result = (ServerType<S>)ServerType.EP_NAME.findFirstSafe(next -> next.getId().equals(myServerTypeId)); assert result != null : "Server type `" + myServerTypeId + "` had been unloaded already"; return result; }