QueryResultFacade implements QueryResult { @Override public String[] getColumnNames() throws RepositoryException { return delegate.getColumnNames(); } @SuppressWarnings("WeakerAccess")  QueryResultFacade(final @NotNull QueryResult delegate, final @NotNull SessionFacade<S> session); @Override String[] getColumnNames(); @Override RowIterator getRows(); @Override NodeIterator getNodes(); @Override String[] getSelectorNames();  }
@Test public void testGetColumnNames() throws Exception { QueryResult delegate = mock(QueryResult.class); QueryResultFacade<Session> facade = getFacade(delegate); final String[] value = new String[0]; when(delegate.getColumnNames()).thenReturn(value); assertSame("same value", value, facade.getColumnNames()); }