### Question:
Utils { public static Long getIdFromSubjectMatch(SubjectMatchType matchType) { Long subjectId = null; if (matchType != null && matchType.getSubjectAttributeDesignator(). getAttributeId().equals("urn:oasis:names:tc:xacml:1.0:subject:subject-id")) { AttributeValueType attributeValue = matchType.getAttributeValue(); String idString = attributeValue.getContent().get(0).toString(); if ("urn:oasis:names:tc:xacml:1.0:function:integer-equal".equals(matchType.getMatchId())) { try { subjectId = Long.parseLong(idString); } catch (Exception e) { s_Logger.log(Level.WARNING, "invalid subject Id " + idString); } } if ("urn:oasis:names:tc:xacml:1.0:function:string-regexp-match".equals(matchType.getMatchId())) { try { subjectId = Long.parseLong(idString.substring(3, idString.length() -1)); } catch (Exception e) { s_Logger.log(Level.WARNING, "invalid external subject Id " + idString); } } } return subjectId; }  static void setSubjectGroupId(SubjectGroup sg, Long id); static void setExclusionSubjectGroupId(SubjectGroup sg, Long id); static SubjectMatchType getSubjectMatchType(Long id); static SubjectMatchType getSubjectMatchType(String idStr); static void setSubjectId(Subject subject, Long id); static void setExclusionSubjectId(Subject subject, Long id); static void setAllSubjectId(Subject subject); static Long getSubjectId(Subject subject); static Long getSubjectGroupId(SubjectGroup sg ); static Long getIdFromSubjectMatch(SubjectMatchType matchType); static boolean isExclusion(Subject subject); static boolean isSubjectType(Subject subject); static boolean isExclusion(SubjectGroup subjectGroup); static boolean isExclusion(List<SubjectMatchType> matchTypes); static boolean isSubjectType(List<SubjectMatchType> matchTypes);  }### Answer:
@Test public void testGetIdFromSubjectMatch(){ final Long id = 1L; Subject subject = new Subject(); Utils.setSubjectId(subject, id); Long idFromSubjectMatch = Utils.getIdFromSubjectMatch(subject.getSubjectMatch().get(0)); assertNotNull(idFromSubjectMatch); assertEquals("ID should be equals to 1 Long type", id, idFromSubjectMatch); }