### Question:
AwsInstanceProfileEC2TrustValidator { boolean checkAssumeRoleInActions(List<Action> actions) { return actions.stream().anyMatch( action -> SecurityTokenServiceActions.AssumeRole.getActionName().equals(action.getActionName())); }  boolean isTrusted(InstanceProfile instanceProfile, ValidationResultBuilder resultBuilder);  }### Answer:
@Test public void assumeRoleNotInActions() { assertThat(awsInstanceProfileEC2TrustValidator.checkAssumeRoleInActions( Collections.singletonList(S3Actions.CreateBucket))).isFalse(); assertThat(awsInstanceProfileEC2TrustValidator.checkAssumeRoleInActions( Collections.singletonList(SecurityTokenServiceActions.AssumeRoleWithSAML))).isFalse(); assertThat(awsInstanceProfileEC2TrustValidator.checkAssumeRoleInActions( Arrays.asList( S3Actions.CreateBucket, SecurityTokenServiceActions.AssumeRoleWithSAML ))).isFalse(); }
@Test public void assumeRoleInActions() { assertThat(awsInstanceProfileEC2TrustValidator.checkAssumeRoleInActions( Collections.singletonList(SecurityTokenServiceActions.AssumeRole))).isTrue(); assertThat(awsInstanceProfileEC2TrustValidator.checkAssumeRoleInActions( Arrays.asList( S3Actions.CreateBucket, SecurityTokenServiceActions.AssumeRole ))).isTrue(); }