[java] How much should a function trust another function