WrappedSortParameterExtractor implements SortParameterExtractor { @Override public Sort extract(Invocation invocation) { if (invocation == null) { throw new InvalidArgumentException("Invocation cannot be null"); } return sort; } WrappedSortParameterExtractor(Sort sort); @Override Sort extract(Invocation invocation);  }
@Test(expectedExceptions = InvalidArgumentException.class) public void testNullInvocation() { final WrappedSortParameterExtractor extractor = new WrappedSortParameterExtractor( new ImmutableSort(new ArrayList<>())); extractor.extract(null); }
@Test public void testIdentity() { final Sort sort = new ImmutableSort(new ArrayList<>()); final WrappedSortParameterExtractor extractor = new WrappedSortParameterExtractor(sort); assertThat(extractor.extract(new ImmutableInvocation(null, new Object[]{})), is(sort)); }