### Question:
EmptyReturnMetadataHandler extends StubMapping implements InternalStubMapping { @Override public List<Action> getActions(AbstractNode node, Frame frame) { if (frame.message instanceof Query) { Queue<List<ByteBuffer>> peerRows = new ArrayDeque<>(); Rows rows = new DefaultRows(buildEmptyRowsMetadata(), peerRows); MessageResponseAction action = new MessageResponseAction(rows); return Collections.singletonList(action); } return Collections.emptyList(); } EmptyReturnMetadataHandler(String matchingQuery); @Override boolean matches(Frame frame); @Override List<Action> getActions(AbstractNode node, Frame frame);  }### Answer:
@Test public void shouldReturnAction() { for (String s : sampleStrings) { List<Action> nodeActions = new EmptyReturnMetadataHandler(s).getActions(null, queryFrame(s)); assertThat(nodeActions).hasSize(1); Action nodeAction = nodeActions.get(0); assertThat(nodeAction).isInstanceOf(MessageResponseAction.class); Message node0Message = ((MessageResponseAction) nodeAction).getMessage(); assertThat(node0Message).isRows().hasRows(0); } }
@Test public void shouldReturnNoActionsForNonMatchingQuery() { assertThat(handler.getActions(null, FrameUtils.wrapRequest(new Startup()))).isEmpty(); }