@Test
public void getBestRankedIsCorrect() {

    ImmutableAuthoritativeRatingVantagePoint rank12 = ImmutableAuthoritativeRatingVantagePoint.builder()
            .vantagePoint(vantagePoint)
            .vantagePointRank(1)
            .dataTypeCode("REF_DATA")
            .dataType(EntityReference.mkRef(EntityKind.DATA_TYPE, 20))
            .dataTypeRank(2)
            .applicationId(205L)
            .rating(AuthoritativenessRating.PRIMARY)
            .build();
    ImmutableAuthoritativeRatingVantagePoint rank22 = rank12.withVantagePointRank(2);
    ImmutableAuthoritativeRatingVantagePoint rank11 = rank12.withDataTypeRank(1);
    Optional<AuthoritativeRatingVantagePoint> bestRankedOrgUnit = AuthoritativeSourceResolver.getMostSpecificRanked(ListUtilities.newArrayList(rank12, rank22));
    Optional<AuthoritativeRatingVantagePoint> bestRankedDataType = AuthoritativeSourceResolver.getMostSpecificRanked(ListUtilities.newArrayList(rank12, rank11));
    Assert.assertTrue(bestRankedOrgUnit.isPresent());
    Assert.assertEquals(rank22, bestRankedOrgUnit.get());
    Assert.assertTrue(bestRankedDataType.isPresent());
    Assert.assertEquals(rank12, bestRankedDataType.get());
}