### Question:
PhasingAppendix extends AbstractAppendix { public void validateFinishHeightAndTime(Integer height, Integer time) throws AplException.NotCurrentlyValidException { if ((this.finishHeight != -1 && time != -1) || (this.finishHeight == -1 && time == -1)) { throw new AplException.NotCurrentlyValidException("Only one parameter should be filled 'phasingFinishHeight or phasingFinishTime'"); } Block lastBlock = lookupBlockchain().getLastBlock(); int lastBlockHeight = lastBlock.getHeight(); int currentTime = lookupTimeService().getEpochTime(); if (time == -1 && (this.finishHeight <= lastBlockHeight + (params.getVoteWeighting().acceptsVotes() ? 2 : 1) || this.finishHeight >= lastBlockHeight + Constants.MAX_PHASING_DURATION)) { throw new AplException.NotCurrentlyValidException("Invalid finish height " + height); } if (this.finishHeight == -1 && time >= currentTime + Constants.MAX_PHASING_TIME_DURATION_SEC) { throw new AplException.NotCurrentlyValidException("Invalid finish time " + time); } } PhasingAppendix(ByteBuffer buffer);  PhasingAppendix(JSONObject attachmentData);  PhasingAppendix(int finishHeight, PhasingParams phasingParams, byte[][] linkedFullHashes, byte[] hashedSecret, byte algorithm); @Override String getAppendixName(); @Override byte getVersion(); @Override int getMySize(); @Override void putMyBytes(ByteBuffer buffer); @Override void putMyJSON(JSONObject json); @Override void validate(Transaction transaction, int blockHeight); void generalValidation(Transaction transaction); void validateFinishHeight(Integer finishHeight); void validateFinishHeightAndTime(Integer height, Integer time); @Override void validateAtFinish(Transaction transaction, int blockHeight); @Override void apply(Transaction transaction, Account senderAccount, Account recipientAccount); @Override boolean isPhasable(); @Override Fee getBaselineFee(Transaction transaction); int getFinishHeight(); long getQuorum(); long[] getWhitelist(); VoteWeighting getVoteWeighting(); byte[][] getLinkedFullHashes(); byte[] getHashedSecret(); byte getAlgorithm(); PhasingParams getParams();  }### Answer:
@Test void validateFinishHeightAndTimeWhenBothNotFilled() { assertThrows(AplException.NotCurrentlyValidException.class, () -> phasingAppendix.validateFinishHeightAndTime(-1, -1)); }
@Test void validateFinishHeightAndTimeWhenHeightNotFilledAndTimeMoreThenMax() { assertThrows(AplException.NotCurrentlyValidException.class, () -> phasingAppendix.validateFinishHeightAndTime(-1, currentTime + Constants.MAX_PHASING_TIME_DURATION_SEC)); }
@Test void validateFinishHeightAndTimeWhenHeightLessThenMin() { assertThrows(AplException.NotCurrentlyValidException.class, () -> phasingAppendix.validateFinishHeightAndTime(lastBlockHeight, -1)); }
@Test void validateFinishHeightAndTimeWhenHeightMoreThenMax() { assertThrows(AplException.NotCurrentlyValidException.class, () -> phasingAppendix.validateFinishHeightAndTime(lastBlockHeight + Constants.MAX_PHASING_DURATION, -1)); }