@Test public void leaseGranted() { LeaseResult result = LeaseResult.leaseGranted(5L); assertTrue(result.isLeaseGranted()); assertEquals(5L, result.getLeaseLength()); }
public static LeaseResult leaseGranted(long leaseLength) { if (leaseLength <= 0) { throw new IllegalArgumentException("Illegal attempt to create a lease with a negative lease length"); } return new LeaseResult(leaseLength); }
LeaseResult { public static LeaseResult leaseGranted(long leaseLength) { if (leaseLength <= 0) { throw new IllegalArgumentException("Illegal attempt to create a lease with a negative lease length"); } return new LeaseResult(leaseLength); } }
LeaseResult { public static LeaseResult leaseGranted(long leaseLength) { if (leaseLength <= 0) { throw new IllegalArgumentException("Illegal attempt to create a lease with a negative lease length"); } return new LeaseResult(leaseLength); } private  LeaseResult(long leaseLength); }
LeaseResult { public static LeaseResult leaseGranted(long leaseLength) { if (leaseLength <= 0) { throw new IllegalArgumentException("Illegal attempt to create a lease with a negative lease length"); } return new LeaseResult(leaseLength); } private  LeaseResult(long leaseLength); static LeaseResult leaseNotGranted(); static LeaseResult leaseGranted(long leaseLength); boolean isLeaseGranted(); long getLeaseLength(); }
LeaseResult { public static LeaseResult leaseGranted(long leaseLength) { if (leaseLength <= 0) { throw new IllegalArgumentException("Illegal attempt to create a lease with a negative lease length"); } return new LeaseResult(leaseLength); } private  LeaseResult(long leaseLength); static LeaseResult leaseNotGranted(); static LeaseResult leaseGranted(long leaseLength); boolean isLeaseGranted(); long getLeaseLength();  }