package org.apache.ambari.server.audit.request.eventcreator;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
<BUG>import java.util.Map;
import org.apache.ambari.server.api.services.Request;
public class RequestAuditEventCreatorHelper {</BUG>
public static String getNamedProperty(Request request, String propertyName) {
<BUG>if (isValid(request, propertyName)) {
return String.valueOf(request.getBody().getNamedPropertySets().iterator().next().getProperties().get(propertyName));
}</BUG>
return null;

package org.apache.ambari.server.audit.request.eventcreator;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import org.apache.ambari.server.api.services.NamedPropertySet;
import org.apache.ambari.server.api.services.Request;
import com.google.common.collect.Iterables;
public class RequestAuditEventCreatorHelper {
public static String getNamedProperty(Request request, String propertyName) {
NamedPropertySet first = Iterables.getFirst(request.getBody().getNamedPropertySets(), null);
if (first != null && first.getProperties().get(propertyName) instanceof String) {
return String.valueOf(first.getProperties().get(propertyName));
