title: Comparator.comparing(((Function<Entity, SubEntity>)Entity::getSubEntity).andThen(SubEntity::getAmount)));
body: <p>what if SubEntity is null, some of of SubEntity itself null then SubEntity::getAmount null pointer so how to avoid</p>