PeerPolicy { public void setContainerLimit( int containerLimit ) { if ( containerLimit < 0 ) { throw new IllegalArgumentException( "Container limit could not be less than 0." ); } this.containerLimit = containerLimit; } PeerPolicy( @JsonProperty( "peerId" ) final String peerId,
                       @JsonProperty( "diskUsageLimit" ) final int diskUsageLimit,
                       @JsonProperty( "cpuUsageLimit" ) final int cpuUsageLimit,
                       @JsonProperty( "memoryUsageLimit" ) final int memoryUsageLimit,
                       @JsonProperty( "networkUsageLimit" ) final int networkUsageLimit,
                       @JsonProperty( "environmentLimit" ) final int environmentLimit,
                       @JsonProperty( "containerLimit" ) final int containerLimit ); int getDiskUsageLimit(); int getCpuUsageLimit(); int getContainerLimit(); int getMemoryUsageLimit(); int getNetworkUsageLimit(); int getEnvironmentLimit(); void setContainerLimit( int containerLimit ); void setCpuUsageLimit( int cpuUsageLimit ); void setDiskUsageLimit( int diskUsageLimit ); void setMemoryUsageLimit( int memoryUsageLimit ); void setNetworkUsageLimit( int networkUsageLimit ); void setEnvironmentLimit( int environmentLimit ); String getPeerId(); @Override boolean equals( Object obj ); @Override int hashCode();  }
@Test( expected = IllegalArgumentException.class ) public void testInvalidContainerLimit() { peerPolicy.setContainerLimit( -1 ); }