### Question:
FieldLineageAdmin { FieldLineageSummary getFieldLineage(Constants.FieldLineage.Direction direction, EndPointField endPointField, long start, long end) { Set<DatasetField> incoming = null; Set<DatasetField> outgoing = null; if (direction == Constants.FieldLineage.Direction.INCOMING || direction == Constants.FieldLineage.Direction.BOTH) { Set<EndPointField> incomingSummary = fieldLineageReader.getIncomingSummary(endPointField, start, end); incoming = convertSummaryToDatasetField(incomingSummary); } if (direction == Constants.FieldLineage.Direction.OUTGOING || direction == Constants.FieldLineage.Direction.BOTH) { Set<EndPointField> outgoingSummary = fieldLineageReader.getOutgoingSummary(endPointField, start, end); outgoing = convertSummaryToDatasetField(outgoingSummary); } return new FieldLineageSummary(incoming, outgoing); } @Inject @VisibleForTesting  FieldLineageAdmin(FieldLineageReader fieldLineageReader, MetadataAdmin metadataAdmin); Set<Field> getFields(EndPoint endPoint, long start, long end, @Nullable String prefix,
                              boolean includeCurrent); DatasetFieldLineageSummary getDatasetFieldLineage(Constants.FieldLineage.Direction direction,
                                                           EndPoint endPoint,
                                                           long start, long end);  }### Answer:
@Test public void testSummary() { FieldLineageAdmin fieldLineageAdmin = new FieldLineageAdmin(new FakeFieldLineageReader(Collections.emptySet(), summary(), Collections.emptySet()), metadataAdmin); EndPoint endPoint = EndPoint.of("ns", "file"); DatasetField datasetField = new DatasetField(new DatasetId("ns", "file"), new HashSet<>(Arrays.asList("a", "b", "c"))); DatasetField anotherDatasetField = new DatasetField(new DatasetId("ns", "anotherfile"), new HashSet<>(Arrays.asList("x", "y", "z"))); Set<DatasetField> expected = new HashSet<>(); expected.add(datasetField); expected.add(anotherDatasetField); FieldLineageSummary summary = fieldLineageAdmin.getFieldLineage(Constants.FieldLineage.Direction.INCOMING, new EndPointField(endPoint, "somefield"), 0, Long.MAX_VALUE); Assert.assertEquals(expected, summary.getIncoming()); Assert.assertNull(summary.getOutgoing()); summary = fieldLineageAdmin.getFieldLineage(Constants.FieldLineage.Direction.OUTGOING, new EndPointField(endPoint, "somefield"), 0, Long.MAX_VALUE); Assert.assertEquals(expected, summary.getOutgoing()); Assert.assertNull(summary.getIncoming()); summary = fieldLineageAdmin.getFieldLineage(Constants.FieldLineage.Direction.BOTH, new EndPointField(endPoint, "somefield"), 0, Long.MAX_VALUE); Assert.assertEquals(expected, summary.getOutgoing()); Assert.assertEquals(expected, summary.getIncoming()); }