tvaultapi/src/main/java/com/tmobile/cso/vault/api/controller/ControllerUtil.java
public static  Map<String,Object> filterDuplicateSvcaccPermissions(Map<String,Object> access) {
		if (!MapUtils.isEmpty(access)) {
			List<Map<String,String>> svcaccPermissions = (List<Map<String,String>>)access.get(TVaultConstants.SVC_ACC_PATH_PREFIX);
			if (svcaccPermissions != null) {
				//map to check duplicate permission
				Map<String,String> filteredPermissions = Collections.synchronizedMap(new HashMap());
				List<Map<String,String>> updatedPermissionList = new ArrayList<>();
				for (Map<String,String> permissionMap: svcaccPermissions) {
					Set<String> keys = permissionMap.keySet();
					String key = keys.stream().findFirst().orElse("");

					if (!key.equals("") && !filteredPermissions.containsKey(key)) {
						filteredPermissions.put(key, permissionMap.get(key));
						Map<String,String> permission = Collections.synchronizedMap(new HashMap());
						permission.put(key, permissionMap.get(key));
						updatedPermissionList.add(permission);
					}
				}
				access.put(TVaultConstants.SVC_ACC_PATH_PREFIX, updatedPermissionList);
			}
		}
		return access;
	}
/**
	 * To filter the duplicate Service account permissions
	 * @param access
	 * @return
	 */
To filter the duplicate Service account permissions
@param access
@return
To filter the duplicate Service account permissions @param access @return
public static  Map<String,Object> filterDuplicateSvcaccPermissions(Map<String,Object> access) {
		if (!MapUtils.isEmpty(access)) {
			List<Map<String,String>> svcaccPermissions = (List<Map<String,String>>)access.get(TVaultConstants.SVC_ACC_PATH_PREFIX);
			if (svcaccPermissions != null) {
				Map<String,String> filteredPermissions = Collections.synchronizedMap(new HashMap());
				List<Map<String,String>> updatedPermissionList = new ArrayList<>();
				for (Map<String,String> permissionMap: svcaccPermissions) {
					Set<String> keys = permissionMap.keySet();
					String key = keys.stream().findFirst().orElse("");
					if (!key.equals("") && !filteredPermissions.containsKey(key)) {
						filteredPermissions.put(key, permissionMap.get(key));
						Map<String,String> permission = Collections.synchronizedMap(new HashMap());
						permission.put(key, permissionMap.get(key));
						updatedPermissionList.add(permission);
					}
				}
				access.put(TVaultConstants.SVC_ACC_PATH_PREFIX, updatedPermissionList);
			}
		}
		return access;
	}
public static Map < String , Object > filterDuplicateSvcaccPermissions ( Map < String , Object > access ) { if ( ! MapUtils . isEmpty ( access ) ) { List < Map < String , String > > svcaccPermissions = ( List < Map < String , String > > ) access . get ( TVaultConstants . SVC_ACC_PATH_PREFIX ) ; if ( svcaccPermissions != null ) { Map < String , String > filteredPermissions = Collections . synchronizedMap ( new HashMap ( ) ) ; List < Map < String , String > > updatedPermissionList = new ArrayList < > ( ) ; for ( Map < String , String > permissionMap : svcaccPermissions ) { Set < String > keys = permissionMap . keySet ( ) ; String key = keys . stream ( ) . findFirst ( ) . orElse ( "" ) ; if ( ! key . equals ( "" ) && ! filteredPermissions . containsKey ( key ) ) { filteredPermissions . put ( key , permissionMap . get ( key ) ) ; Map < String , String > permission = Collections . synchronizedMap ( new HashMap ( ) ) ; permission . put ( key , permissionMap . get ( key ) ) ; updatedPermissionList . add ( permission ) ; } } access . put ( TVaultConstants . SVC_ACC_PATH_PREFIX , updatedPermissionList ) ; } } return access ; }
To filter the duplicate Service account permissions
 @param access
 @return
To filter the duplicate Service account permissions @param access @return
//map to check duplicate permission